diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-06-25 21:19:42 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-06-25 21:19:42 +0800 |
commit | e9c0b5431cbd7430ddec9fd17983241018fd8a55 (patch) | |
tree | b61f54ee4991753f510292a1606d43e4626507f7 /cmd/geth | |
parent | fdbf8be7356cb8a80c6fdfe0d24b0863903e1832 (diff) | |
download | go-tangerine-e9c0b5431cbd7430ddec9fd17983241018fd8a55.tar.gz go-tangerine-e9c0b5431cbd7430ddec9fd17983241018fd8a55.tar.zst go-tangerine-e9c0b5431cbd7430ddec9fd17983241018fd8a55.zip |
cmd/geth: finalize mem stats
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/main.go | 12 | ||||
-rw-r--r-- | cmd/geth/monitorcmd.go | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 53f6a95d9..fcf7f27f0 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -289,10 +289,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso } // Start system runtime metrics collection go func() { - used := metrics.GetOrRegisterMeter("system/memory/used", metrics.DefaultRegistry) - total := metrics.GetOrRegisterMeter("system/memory/total", metrics.DefaultRegistry) - mallocs := metrics.GetOrRegisterMeter("system/memory/mallocs", metrics.DefaultRegistry) + allocs := metrics.GetOrRegisterMeter("system/memory/allocs", metrics.DefaultRegistry) frees := metrics.GetOrRegisterMeter("system/memory/frees", metrics.DefaultRegistry) + inuse := metrics.GetOrRegisterMeter("system/memory/inuse", metrics.DefaultRegistry) + pauses := metrics.GetOrRegisterMeter("system/memory/pauses", metrics.DefaultRegistry) stats := make([]*runtime.MemStats, 2) for i := 0; i < len(stats); i++ { @@ -301,10 +301,10 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso for i := 1; ; i++ { runtime.ReadMemStats(stats[i%2]) - used.Mark(int64(stats[i%2].Alloc - stats[(i-1)%2].Alloc)) - total.Mark(int64(stats[i%2].TotalAlloc - stats[(i-1)%2].TotalAlloc)) - mallocs.Mark(int64(stats[i%2].Mallocs - stats[(i-1)%2].Mallocs)) + allocs.Mark(int64(stats[i%2].Mallocs - stats[(i-1)%2].Mallocs)) frees.Mark(int64(stats[i%2].Frees - stats[(i-1)%2].Frees)) + inuse.Mark(int64(stats[i%2].Alloc - stats[(i-1)%2].Alloc)) + pauses.Mark(int64(stats[i%2].PauseTotalNs - stats[(i-1)%2].PauseTotalNs)) time.Sleep(3 * time.Second) } diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index 43937dcaa..bb9c61a00 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -282,7 +282,7 @@ func updateChart(metric string, data []float64, chart *termui.LineChart, err err chart.Border.Label = metric units := dataUnits - if strings.Contains(metric, "Percentiles") { + if strings.Contains(metric, "/Percentiles/") || strings.Contains(metric, "/pauses/") { units = timeUnits } if len(units[unit]) > 0 { |