mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
metrics: enable the metrics by command line only
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
641df0e39b
commit
3711a738bd
3 changed files with 1 additions and 11 deletions
|
|
@ -257,12 +257,6 @@ func dumpConfig(ctx *cli.Context) error {
|
|||
}
|
||||
|
||||
func applyMetricConfig(ctx *cli.Context, cfg *gethConfig) {
|
||||
if ctx.IsSet(utils.MetricsEnabledFlag.Name) {
|
||||
cfg.Metrics.Enabled = ctx.Bool(utils.MetricsEnabledFlag.Name)
|
||||
}
|
||||
if ctx.IsSet(utils.MetricsEnabledExpensiveFlag.Name) {
|
||||
cfg.Metrics.EnabledExpensive = ctx.Bool(utils.MetricsEnabledExpensiveFlag.Name)
|
||||
}
|
||||
if ctx.IsSet(utils.MetricsHTTPFlag.Name) {
|
||||
cfg.Metrics.HTTP = ctx.String(utils.MetricsHTTPFlag.Name)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2044,7 +2044,7 @@ func SetupMetrics(ctx *cli.Context) {
|
|||
}
|
||||
|
||||
func SetupMetricsFromConfig(c *metrics.Config) {
|
||||
if !c.Enabled {
|
||||
if metrics.Enabled {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ import (
|
|||
|
||||
// Config contains the configuration for the metric collection.
|
||||
type Config struct {
|
||||
Enabled bool `toml:",omitempty"`
|
||||
EnabledExpensive bool `toml:",omitempty"`
|
||||
HTTP string `toml:",omitempty"`
|
||||
Port int `toml:",omitempty"`
|
||||
EnableInfluxDB bool `toml:",omitempty"`
|
||||
|
|
@ -54,8 +52,6 @@ func (c *Config) Validate() error {
|
|||
|
||||
// DefaultConfig is the default config for metrics used in go-ethereum.
|
||||
var DefaultConfig = Config{
|
||||
Enabled: false,
|
||||
EnabledExpensive: false,
|
||||
HTTP: "127.0.0.1",
|
||||
Port: 6060,
|
||||
EnableInfluxDB: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue