forked from InjectiveLabs/metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreports.go
36 lines (29 loc) · 970 Bytes
/
reports.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
36
package metrics
func CustomReport(reportFn func(s Statter, tagSpec []string), tags ...Tags) {
clientMux.RLock()
defer clientMux.RUnlock()
if client == nil {
return
}
reportFn(client, JoinTags(tags...))
}
func SlowSubscriberEventsDropped(amount int, tags ...Tags) {
CustomReport(func(s Statter, tagSpec []string) {
s.Count("pubsub.slow_subscriber.events_dropped", int64(amount), tagSpec, 1)
})
}
func SpotTradesBatchSubmitted(size int, tags ...Tags) {
CustomReport(func(s Statter, tagSpec []string) {
s.Count("events.spot_trades_batch.size", int64(size), tagSpec, 1)
})
}
func DerivativeTradesBatchSubmitted(size int, tags ...Tags) {
CustomReport(func(s Statter, tagSpec []string) {
s.Count("events.derivative_trades_batch.size", int64(size), tagSpec, 1)
})
}
func IndexPriceUpdatesBatchSubmitted(size int, tags ...Tags) {
CustomReport(func(s Statter, tagSpec []string) {
s.Count("events.set_price_batch.size", int64(size), tagSpec, 1)
})
}