mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-20 23:52:41 +02:00
Refactor handling of runtime configuration to prepare for reloading
This commit is contained in:
24
cmd/backup/profile.go
Normal file
24
cmd/backup/profile.go
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright 2024 - Offen Authors <hioffen@posteo.de>
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
package main
|
||||
|
||||
import "runtime"
|
||||
|
||||
func (c *command) profile() {
|
||||
memStats := runtime.MemStats{}
|
||||
runtime.ReadMemStats(&memStats)
|
||||
c.logger.Info(
|
||||
"Collecting runtime information",
|
||||
"num_goroutines",
|
||||
runtime.NumGoroutine(),
|
||||
"memory_heap_alloc",
|
||||
formatBytes(memStats.HeapAlloc, false),
|
||||
"memory_heap_inuse",
|
||||
formatBytes(memStats.HeapInuse, false),
|
||||
"memory_heap_sys",
|
||||
formatBytes(memStats.HeapSys, false),
|
||||
"memory_heap_objects",
|
||||
memStats.HeapObjects,
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user