mirror of
https://github.com/offen/docker-volume-backup.git
synced 2024-11-14 10:30:27 +01:00
25 lines
561 B
Go
25 lines
561 B
Go
|
// 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,
|
||
|
)
|
||
|
}
|