-
Notifications
You must be signed in to change notification settings - Fork 175
/
engine.go
35 lines (26 loc) · 996 Bytes
/
engine.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package unstaked
import (
"github.com/onflow/flow-go/module"
)
type EngineCollector struct {
metrics module.EngineMetrics
}
var _ module.EngineMetrics = (*EngineCollector)(nil)
func NewUnstakedEngineCollector(metrics module.EngineMetrics) *EngineCollector {
return &EngineCollector{metrics}
}
func (ec *EngineCollector) MessageSent(engine string, message string) {
ec.metrics.MessageSent("unstaked_"+engine, message)
}
func (ec *EngineCollector) MessageReceived(engine string, message string) {
ec.metrics.MessageReceived("unstaked_"+engine, message)
}
func (ec *EngineCollector) MessageHandled(engine string, message string) {
ec.metrics.MessageHandled("unstaked_"+engine, message)
}
func (ec *EngineCollector) InboundMessageDropped(engine string, message string) {
ec.metrics.InboundMessageDropped("unstaked_"+engine, message)
}
func (ec *EngineCollector) OutboundMessageDropped(engine string, message string) {
ec.metrics.OutboundMessageDropped("unstaked_"+engine, message)
}