We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37e3816 commit 2e2ab3eCopy full SHA for 2e2ab3e
mstats/mstats.go
@@ -29,13 +29,17 @@ var NumGC Var
29
// Alloc is the number of bytes allocated and not yet freed by the application
30
var Alloc Var
31
32
+// TotalAlloc is the total number of bytes allocated by the application
33
+var TotalAlloc Var
34
+
35
// Start polls runtime.ReadMemStats with interval d and updates the package level variables
36
func Start(d time.Duration) {
37
for range time.Tick(d) {
38
var m runtime.MemStats
39
runtime.ReadMemStats(&m)
40
PauseNS.Store(m.PauseTotalNs)
41
Alloc.Store(m.Alloc)
42
+ TotalAlloc.Store(m.TotalAlloc)
43
NumGC.Store(uint64(m.NumGC))
44
}
45
0 commit comments