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:
Martin Holst Swende
2016-11-01 13:46:11 +01:00
committed by Péter Szilágyi
parent f4d878f3d8
commit 36956da4d2
2 changed files with 39 additions and 0 deletions

View File

@ -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 {