Compare commits

...

2 Commits

Author SHA1 Message Date
Frederik Ring
106fa2f204 Also log number of objects in heap 2024-02-11 12:17:13 +01:00
Frederik Ring
d3e82c0c5c Possible error on scheduling profiling job is unchecked 2024-02-10 12:19:40 +01:00

View File

@@ -191,7 +191,7 @@ func (c *command) runInForeground(profileCronExpression string) error {
} }
if profileCronExpression != "" { if profileCronExpression != "" {
cr.AddFunc(profileCronExpression, func() { if _, err := cr.AddFunc(profileCronExpression, func() {
memStats := runtime.MemStats{} memStats := runtime.MemStats{}
runtime.ReadMemStats(&memStats) runtime.ReadMemStats(&memStats)
c.logger.Info( c.logger.Info(
@@ -204,8 +204,12 @@ func (c *command) runInForeground(profileCronExpression string) error {
formatBytes(memStats.HeapInuse, false), formatBytes(memStats.HeapInuse, false),
"memory_heap_sys", "memory_heap_sys",
formatBytes(memStats.HeapSys, false), formatBytes(memStats.HeapSys, false),
"memory_heap_objects",
memStats.HeapObjects,
) )
}) }); err != nil {
return fmt.Errorf("runInForeground: error adding profiling job: %w", err)
}
} }
var quit = make(chan os.Signal, 1) var quit = make(chan os.Signal, 1)