aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-06-25 16:42:45 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-06-25 16:42:45 +0800
commit3ea6b5ae32215daa6393e02682d6946a2aa89af3 (patch)
treecf0726cd63ea21ecc29420ce975fda0e1d0a85df /cmd
parentd02f07a983ef4b42bfda86bd46c200bb4104e922 (diff)
downloadgo-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.tar
go-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.tar.gz
go-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.tar.bz2
go-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.tar.lz
go-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.tar.xz
go-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.tar.zst
go-tangerine-3ea6b5ae32215daa6393e02682d6946a2aa89af3.zip
cmd/geth: list the available metrics if none specified
Diffstat (limited to 'cmd')
-rw-r--r--cmd/geth/monitorcmd.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go
index 492865d0e..b51da91e6 100644
--- a/cmd/geth/monitorcmd.go
+++ b/cmd/geth/monitorcmd.go
@@ -71,6 +71,19 @@ func monitor(ctx *cli.Context) {
utils.Fatalf("Failed to retrieve system metrics: %v", err)
}
monitored := resolveMetrics(metrics, ctx.Args())
+ if len(monitored) == 0 {
+ list := []string{}
+ for _, metric := range expandMetrics(metrics, "") {
+ switch {
+ case strings.HasSuffix(metric, "/0"):
+ list = append(list, strings.Replace(metric, "/0", "/[0-100]", -1))
+ case !strings.Contains(metric, "Percentiles"):
+ list = append(list, metric)
+ }
+ }
+ sort.Strings(list)
+ utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - "))
+ }
sort.Strings(monitored)
// Create and configure the chart UI defaults