From 5c715b382a2603a2223999b630e7883c0e06192c Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 5 Feb 2020 16:19:11 +0100 Subject: [PATCH 1/2] cmd/geth: enable metrics for geth import command --- cmd/geth/chaincmd.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 5b176b6da1bc..6307e69190ce 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -36,6 +36,7 @@ import ( "github.com/ethereum/go-ethereum/eth/downloader" "github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/log" + "github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/trie" "gopkg.in/urfave/cli.v1" ) @@ -254,6 +255,10 @@ func importChain(ctx *cli.Context) error { if len(ctx.Args()) < 1 { utils.Fatalf("This command requires an argument.") } + // Start metrics export if enabled + utils.SetupMetrics(ctx) + // Start system runtime metrics collection + go metrics.CollectProcessMetrics(3 * time.Second) stack := makeFullNode(ctx) defer stack.Close() From 37d2a6518cd57606be5ca5bda5f0021f23428c60 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Thu, 26 Mar 2020 09:45:05 +0100 Subject: [PATCH 2/2] cmd/geth: enable metrics-flags for import command --- cmd/geth/chaincmd.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index 6307e69190ce..cf36fab0cfd8 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -82,6 +82,14 @@ The dumpgenesis command dumps the genesis block configuration in JSON format to utils.GCModeFlag, utils.CacheDatabaseFlag, utils.CacheGCFlag, + utils.MetricsEnabledFlag, + utils.MetricsEnabledExpensiveFlag, + utils.MetricsEnableInfluxDBFlag, + utils.MetricsInfluxDBEndpointFlag, + utils.MetricsInfluxDBDatabaseFlag, + utils.MetricsInfluxDBUsernameFlag, + utils.MetricsInfluxDBPasswordFlag, + utils.MetricsInfluxDBTagsFlag, }, Category: "BLOCKCHAIN COMMANDS", Description: `