cmd, core, eth, metrics, p2p: require enabling metrics

This commit is contained in:
Péter Szilágyi
2015-06-29 16:11:01 +03:00
committed by Jeffrey Wilcke
parent ccbb56b4f2
commit 01fe972113
9 changed files with 111 additions and 55 deletions

View File

@ -272,6 +272,7 @@ JavaScript API. See https://github.com/ethereum/go-ethereum/wiki/Javascipt-Conso
utils.LogJSONFlag,
utils.PProfEanbledFlag,
utils.PProfPortFlag,
utils.MetricsEnabledFlag,
utils.SolcPathFlag,
utils.GpoMinGasPriceFlag,
utils.GpoMaxGasPriceFlag,

View File

@ -75,7 +75,12 @@ func monitor(ctx *cli.Context) {
if len(monitored) == 0 {
list := expandMetrics(metrics, "")
sort.Strings(list)
utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - "))
if len(list) > 0 {
utils.Fatalf("No metrics specified.\n\nAvailable:\n - %s", strings.Join(list, "\n - "))
} else {
utils.Fatalf("No metrics specified.\n\nNo metrics collected (--metrics)\n")
}
}
sort.Strings(monitored)
if cols := len(monitored) / ctx.Int(monitorCommandRowsFlag.Name); cols > 6 {

View File

@ -10,6 +10,8 @@ import (
"path/filepath"
"runtime"
"github.com/ethereum/go-ethereum/metrics"
"github.com/codegangsta/cli"
"github.com/ethereum/ethash"
"github.com/ethereum/go-ethereum/accounts"
@ -187,6 +189,10 @@ var (
Usage: "Port on which the profiler should listen",
Value: 6060,
}
MetricsEnabledFlag = cli.BoolFlag{
Name: metrics.MetricsEnabledFlag,
Usage: "Enables metrics collection and reporting",
}
// RPC settings
RPCEnabledFlag = cli.BoolFlag{