make measurements more accurate in notifications worker

This commit is contained in:
Andre Medeiros 2022-10-26 20:26:38 -04:00
parent bf2dff8497
commit a7f585be95

View file

@ -145,7 +145,7 @@ func (nc *notificationsConsumer) Consume(delivery rmq.Delivery) {
key := fmt.Sprintf("locks:accounts:%s", id)
// Measure queue latency
ttl := nc.redis.TTL(nc, key).Val()
ttl := nc.redis.PTTL(nc, key).Val()
age := (domain.NotificationCheckTimeout - ttl)
_ = nc.statsd.Histogram("apollo.dequeue.latency", float64(age.Milliseconds()), []string{"queue:notifications"}, 0.1)