Skip to content

Commit e9c0b54

Browse files
committed
cmd/geth: finalize mem stats
1 parent fdbf8be commit e9c0b54

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

cmd/geth/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
289289
}
290290
// Start system runtime metrics collection
291291
go func() {
292-
used := metrics.GetOrRegisterMeter("system/memory/used", metrics.DefaultRegistry)
293-
total := metrics.GetOrRegisterMeter("system/memory/total", metrics.DefaultRegistry)
294-
mallocs := metrics.GetOrRegisterMeter("system/memory/mallocs", metrics.DefaultRegistry)
292+
allocs := metrics.GetOrRegisterMeter("system/memory/allocs", metrics.DefaultRegistry)
295293
frees := metrics.GetOrRegisterMeter("system/memory/frees", metrics.DefaultRegistry)
294+
inuse := metrics.GetOrRegisterMeter("system/memory/inuse", metrics.DefaultRegistry)
295+
pauses := metrics.GetOrRegisterMeter("system/memory/pauses", metrics.DefaultRegistry)
296296

297297
stats := make([]*runtime.MemStats, 2)
298298
for i := 0; i < len(stats); i++ {
@@ -301,10 +301,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
301301
for i := 1; ; i++ {
302302
runtime.ReadMemStats(stats[i%2])
303303

304-
used.Mark(int64(stats[i%2].Alloc - stats[(i-1)%2].Alloc))
305-
total.Mark(int64(stats[i%2].TotalAlloc - stats[(i-1)%2].TotalAlloc))
306-
mallocs.Mark(int64(stats[i%2].Mallocs - stats[(i-1)%2].Mallocs))
304+
allocs.Mark(int64(stats[i%2].Mallocs - stats[(i-1)%2].Mallocs))
307305
frees.Mark(int64(stats[i%2].Frees - stats[(i-1)%2].Frees))
306+
inuse.Mark(int64(stats[i%2].Alloc - stats[(i-1)%2].Alloc))
307+
pauses.Mark(int64(stats[i%2].PauseTotalNs - stats[(i-1)%2].PauseTotalNs))
308308

309309
time.Sleep(3 * time.Second)
310310
}

cmd/geth/monitorcmd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func updateChart(metric string, data []float64, chart *termui.LineChart, err err
282282
chart.Border.Label = metric
283283

284284
units := dataUnits
285-
if strings.Contains(metric, "Percentiles") {
285+
if strings.Contains(metric, "/Percentiles/") || strings.Contains(metric, "/pauses/") {
286286
units = timeUnits
287287
}
288288
if len(units[unit]) > 0 {

0 commit comments

Comments
 (0)