core: metrics collection for transaction events (#3157)
* core: Add metrics collection for transaction events; replace/discard for pending and future queues, as well as invalid transactions * core: change namespace for txpool metrics * core: define more metrics (not yet used) * core: implement more tx metrics for when transactions are dropped * core: minor formatting tweeks (will squash later) * core: remove superfluous meter, fix missing pending nofunds * core, metrics: switch txpool meters to counters
This commit is contained in:
committed by
Péter Szilágyi
parent
f4d878f3d8
commit
36956da4d2
@ -48,6 +48,15 @@ func init() {
|
||||
exp.Exp(metrics.DefaultRegistry)
|
||||
}
|
||||
|
||||
// NewCounter create a new metrics Counter, either a real one of a NOP stub depending
|
||||
// on the metrics flag.
|
||||
func NewCounter(name string) metrics.Counter {
|
||||
if !Enabled {
|
||||
return new(metrics.NilCounter)
|
||||
}
|
||||
return metrics.GetOrRegisterCounter(name, metrics.DefaultRegistry)
|
||||
}
|
||||
|
||||
// NewMeter create a new metrics Meter, either a real one of a NOP stub depending
|
||||
// on the metrics flag.
|
||||
func NewMeter(name string) metrics.Meter {
|
||||
|
Reference in New Issue
Block a user