@@ -36,6 +36,7 @@ import (
3636 "github.com/ethereum/go-ethereum/eth/downloader"
3737 "github.com/ethereum/go-ethereum/event"
3838 "github.com/ethereum/go-ethereum/log"
39+ "github.com/ethereum/go-ethereum/metrics"
3940 "github.com/ethereum/go-ethereum/trie"
4041 "gopkg.in/urfave/cli.v1"
4142)
@@ -82,6 +83,14 @@ The dumpgenesis command dumps the genesis block configuration in JSON format to
8283 utils .SnapshotFlag ,
8384 utils .CacheDatabaseFlag ,
8485 utils .CacheGCFlag ,
86+ utils .MetricsEnabledFlag ,
87+ utils .MetricsEnabledExpensiveFlag ,
88+ utils .MetricsEnableInfluxDBFlag ,
89+ utils .MetricsInfluxDBEndpointFlag ,
90+ utils .MetricsInfluxDBDatabaseFlag ,
91+ utils .MetricsInfluxDBUsernameFlag ,
92+ utils .MetricsInfluxDBPasswordFlag ,
93+ utils .MetricsInfluxDBTagsFlag ,
8594 },
8695 Category : "BLOCKCHAIN COMMANDS" ,
8796 Description : `
@@ -255,6 +264,10 @@ func importChain(ctx *cli.Context) error {
255264 if len (ctx .Args ()) < 1 {
256265 utils .Fatalf ("This command requires an argument." )
257266 }
267+ // Start metrics export if enabled
268+ utils .SetupMetrics (ctx )
269+ // Start system runtime metrics collection
270+ go metrics .CollectProcessMetrics (3 * time .Second )
258271 stack := makeFullNode (ctx )
259272 defer stack .Close ()
260273
0 commit comments