github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/module/metrics/unstaked/engine.go (about) 1 package unstaked 2 3 import ( 4 "github.com/onflow/flow-go/module" 5 ) 6 7 type EngineCollector struct { 8 metrics module.EngineMetrics 9 } 10 11 var _ module.EngineMetrics = (*EngineCollector)(nil) 12 13 func NewUnstakedEngineCollector(metrics module.EngineMetrics) *EngineCollector { 14 return &EngineCollector{metrics} 15 } 16 17 func (ec *EngineCollector) MessageSent(engine string, message string) { 18 ec.metrics.MessageSent("unstaked_"+engine, message) 19 } 20 21 func (ec *EngineCollector) MessageReceived(engine string, message string) { 22 ec.metrics.MessageReceived("unstaked_"+engine, message) 23 } 24 25 func (ec *EngineCollector) MessageHandled(engine string, message string) { 26 ec.metrics.MessageHandled("unstaked_"+engine, message) 27 } 28 29 func (ec *EngineCollector) InboundMessageDropped(engine string, message string) { 30 ec.metrics.InboundMessageDropped("unstaked_"+engine, message) 31 } 32 33 func (ec *EngineCollector) OutboundMessageDropped(engine string, message string) { 34 ec.metrics.OutboundMessageDropped("unstaked_"+engine, message) 35 }