Skip to content

Commit

Permalink
fix: log type for numgc
Browse files Browse the repository at this point in the history
  • Loading branch information
thoas committed Sep 25, 2023
1 parent def85e8 commit a18ca8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func logMemStats(ctx context.Context, logger *slog.Logger) {
slog.String("heap-alloc", fmt.Sprintf("%v MiB", bToMb(m.HeapAlloc))),
slog.String("total-alloc", fmt.Sprintf("%v MiB", bToMb(m.TotalAlloc))),
slog.String("sys", fmt.Sprintf("%v MiB", bToMb(m.Sys))),
slog.String("numgc", fmt.Sprintf("%v", m.NumGC)),
slog.Int("numgc", int(m.NumGC)),
slog.Int("total-goroutine", runtime.NumGoroutine()),
}
logger.LogAttrs(ctx, slog.LevelInfo, "Memory stats", attributes...)
Expand Down

0 comments on commit a18ca8d

Please sign in to comment.