more precision on measurement

This commit is contained in:
Andre Medeiros 2022-10-26 20:20:45 -04:00
parent 9154ee8e7f
commit bf2dff8497
3 changed files with 3 additions and 1 deletions

View file

@ -25,6 +25,7 @@ func TestWatcherKeywordMatches(t *testing.T) {
} }
for scenario, tc := range tt { for scenario, tc := range tt {
tc := tc
t.Run(scenario, func(t *testing.T) { t.Run(scenario, func(t *testing.T) {
t.Parallel() t.Parallel()

View file

@ -369,6 +369,7 @@ func (rac *AuthenticatedClient) request(ctx context.Context, r *Request, errmap
return rh(val), nil return rh(val), nil
} }
//nolint:unparam
func (rac *AuthenticatedClient) logRequest() error { func (rac *AuthenticatedClient) logRequest() error {
if rac.redditId == SkipRateLimiting { if rac.redditId == SkipRateLimiting {
return nil return nil

View file

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