Skip to content

Commit

Permalink
Remove now unneeded option metrics-enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Jan 14, 2025
1 parent e5185d1 commit 996650f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
15 changes: 0 additions & 15 deletions metrics/prometheus/noop_register.go

This file was deleted.

5 changes: 1 addition & 4 deletions plugin/evm/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const (
defaultSyncableCommitInterval = defaultCommitInterval * 4
defaultSnapshotWait = false
defaultRpcGasCap = 50_000_000 // Default to 50M Gas Limit
defaultRpcTxFeeCap = 100 // 100 AVAX
defaultMetricsEnabled = true
defaultRpcTxFeeCap = 100
defaultMetricsExpensiveEnabled = true
defaultApiMaxDuration = 0 // Default to no maximum API call duration
defaultWsCpuRefillRate = 0 // Default to no maximum WS CPU usage
Expand Down Expand Up @@ -126,7 +125,6 @@ type Config struct {
PruneWarpDB bool `json:"prune-warp-db-enabled"` // Determines if the warpDB should be cleared on startup

// Metric Settings
MetricsEnabled bool `json:"metrics-enabled,omitempty"`
MetricsExpensiveEnabled bool `json:"metrics-expensive-enabled"` // Debug-level metrics that might impact runtime performance

// API Settings
Expand Down Expand Up @@ -245,7 +243,6 @@ func (c *Config) SetDefaults(txPoolConfig TxPoolConfig) {
c.EnabledEthAPIs = defaultEnabledAPIs
c.RPCGasCap = defaultRpcGasCap
c.RPCTxFeeCap = defaultRpcTxFeeCap
c.MetricsEnabled = defaultMetricsEnabled
c.MetricsExpensiveEnabled = defaultMetricsExpensiveEnabled

// TxPool settings
Expand Down
9 changes: 2 additions & 7 deletions plugin/evm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,13 +393,8 @@ func (vm *VM) Initialize(
vm.toEngine = toEngine
vm.shutdownChan = make(chan struct{}, 1)

if vm.config.MetricsEnabled {
if err := vm.initializeMetrics(); err != nil {
return fmt.Errorf("failed to initialize metrics: %w", err)
}
} else {
metrics.Enabled = false // reset global variable to false for tests
vm.sdkMetrics = &corethprometheus.NoopRegister{}
if err := vm.initializeMetrics(); err != nil {
return fmt.Errorf("failed to initialize metrics: %w", err)
}

// Initialize the database
Expand Down

0 comments on commit 996650f

Please sign in to comment.