mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-25 21:27:42 +00:00
fix stats name
This commit is contained in:
parent
73da53ab70
commit
3b08d6b8e4
2 changed files with 8 additions and 1 deletions
|
@ -138,7 +138,7 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
defer func() {
|
defer func() {
|
||||||
elapsed := time.Now().Sub(now).Milliseconds()
|
elapsed := time.Now().Sub(now).Milliseconds()
|
||||||
_ = nc.statsd.Histogram("apollo.queue.runtime", float64(elapsed), []string{"queue:notifications"}, 0.1)
|
_ = nc.statsd.Histogram("apollo.consumer.runtime", float64(elapsed), []string{"queue:notifications"}, 0.1)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
id := delivery.Payload()
|
id := delivery.Payload()
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/DataDog/datadog-go/statsd"
|
"github.com/DataDog/datadog-go/statsd"
|
||||||
"github.com/adjust/rmq/v4"
|
"github.com/adjust/rmq/v4"
|
||||||
|
@ -100,6 +101,12 @@ func NewStuckNotificationsConsumer(snw *stuckNotificationsWorker, tag int) *stuc
|
||||||
}
|
}
|
||||||
|
|
||||||
func (snc *stuckNotificationsConsumer) Consume(delivery rmq.Delivery) {
|
func (snc *stuckNotificationsConsumer) Consume(delivery rmq.Delivery) {
|
||||||
|
now := time.Now()
|
||||||
|
defer func() {
|
||||||
|
elapsed := time.Now().Sub(now).Milliseconds()
|
||||||
|
_ = snc.statsd.Histogram("apollo.consumer.runtime", float64(elapsed), []string{"queue:stuck-notifications"}, 0.1)
|
||||||
|
}()
|
||||||
|
|
||||||
id, err := strconv.ParseInt(delivery.Payload(), 10, 64)
|
id, err := strconv.ParseInt(delivery.Payload(), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
snc.logger.Error("failed to parse account id from payload", zap.Error(err), zap.String("payload", delivery.Payload()))
|
snc.logger.Error("failed to parse account id from payload", zap.Error(err), zap.String("payload", delivery.Payload()))
|
||||||
|
|
Loading…
Reference in a new issue