Skip to content

NewMeterForced

Source (upstream pre-purge) Current
File metrics/meter.go meter_forced.go
Symbol NewMeterForced NewMeterForced
Ref 8b6cf128a~1 etc/v1.17.4-full-node

ADAPT: the metrics refactor (#28035) moved the enabled-gate from the meter constructors into the arbiter tick loop, so the revived forced variant registers with a dedicated ungated ticker (forcedArbiter) instead of skipping a constructor gate. Consumed by the ethash hashrate meter so eth_hashrate and the netstats hashrate work without --metrics.

3-way merge — purge → getc ← upstream

pre-purgefork-only
// NewMeterForced constructs a new Meter and launches a goroutine no matter
// the global switch is enabled or not. Forced meters cannot be stopped:
// they tick for the lifetime of the process.
func NewMeterForced() *Meter {
m := newMeter()
forcedArbiter.add(m)
forcedArbiter.once.Do(func() { go forcedArbiter.loopForced() })
return m
}

← Consensus & Ethash