mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-12 23:17:44 +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()
|
||||
defer func() {
|
||||
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()
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/DataDog/datadog-go/statsd"
|
||||
"github.com/adjust/rmq/v4"
|
||||
|
@ -100,6 +101,12 @@ func NewStuckNotificationsConsumer(snw *stuckNotificationsWorker, tag int) *stuc
|
|||
}
|
||||
|
||||
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)
|
||||
if err != nil {
|
||||
snc.logger.Error("failed to parse account id from payload", zap.Error(err), zap.String("payload", delivery.Payload()))
|
||||
|
|
Loading…
Reference in a new issue