99 "os"
1010 "runtime/metrics"
1111 "runtime/pprof"
12- "strconv"
1312 "strings"
14- "syscall"
1513 "time"
1614
1715 "github.com/ethereum/go-ethereum/log"
@@ -32,35 +30,13 @@ var EnabledExpensive = false
3230// enablerFlags is the CLI flag names to use to enable metrics collections.
3331var enablerFlags = []string {"metrics" }
3432
35- // enablerEnvVars is the env var names to use to enable metrics collections.
36- var enablerEnvVars = []string {"GETH_METRICS" }
37-
3833// expensiveEnablerFlags is the CLI flag names to use to enable metrics collections.
3934var expensiveEnablerFlags = []string {"metrics.expensive" }
4035
41- // expensiveEnablerEnvVars is the env var names to use to enable metrics collections.
42- var expensiveEnablerEnvVars = []string {"GETH_METRICS_EXPENSIVE" }
43-
4436// Init enables or disables the metrics system. Since we need this to run before
4537// any other code gets to create meters and timers, we'll actually do an ugly hack
4638// and peek into the command line args for the metrics flag.
4739func init () {
48- for _ , enabler := range enablerEnvVars {
49- if val , found := syscall .Getenv (enabler ); found && ! Enabled {
50- if enable , _ := strconv .ParseBool (val ); enable { // ignore error, flag parser will choke on it later
51- log .Info ("Enabling metrics collection" )
52- Enabled = true
53- }
54- }
55- }
56- for _ , enabler := range expensiveEnablerEnvVars {
57- if val , found := syscall .Getenv (enabler ); found && ! EnabledExpensive {
58- if enable , _ := strconv .ParseBool (val ); enable { // ignore error, flag parser will choke on it later
59- log .Info ("Enabling expensive metrics collection" )
60- EnabledExpensive = true
61- }
62- }
63- }
6440 for _ , arg := range os .Args {
6541 flag := strings .TrimLeft (arg , "-" )
6642
0 commit comments