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