From 74a87fce344a21538284159cea79be61fbb6b8df Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Thu, 16 Mar 2023 10:34:15 -0400 Subject: [PATCH] update dequeue metric --- internal/cmd/scheduler.go | 22 ++++++++++++---------- internal/domain/account.go | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/internal/cmd/scheduler.go b/internal/cmd/scheduler.go index 8fc7bd0..5bfc42f 100644 --- a/internal/cmd/scheduler.go +++ b/internal/cmd/scheduler.go @@ -534,15 +534,17 @@ func enqueueAccounts(ctx context.Context, logger *zap.Logger, statsd *statsd.Cli } wg.Wait() - var ( - enqueued int64 = 0 - skipped int64 = 0 - ) + /* + var ( + enqueued int64 = 0 + skipped int64 = 0 + ) - defer func() { - tags := []string{"queue:notifications"} - _ = statsd.Histogram("apollo.queue.enqueued", float64(enqueued), tags, 1) - _ = statsd.Histogram("apollo.queue.skipped", float64(skipped), tags, 1) - _ = statsd.Histogram("apollo.queue.runtime", float64(time.Since(now).Milliseconds()), tags, 1) - }() + defer func() { + tags := []string{"queue:notifications"} + _ = statsd.Histogram("apollo.queue.enqueued", float64(enqueued), tags, 1) + _ = statsd.Histogram("apollo.queue.skipped", float64(skipped), tags, 1) + _ = statsd.Histogram("apollo.queue.runtime", float64(time.Since(now).Milliseconds()), tags, 1) + }() + */ } diff --git a/internal/domain/account.go b/internal/domain/account.go index 7630f0f..9c20731 100644 --- a/internal/domain/account.go +++ b/internal/domain/account.go @@ -9,7 +9,7 @@ import ( ) const ( - NotificationCheckInterval = 10 * time.Second // time between notification checks + NotificationCheckInterval = 60 * time.Second // time between notification checks NotificationCheckTimeout = 5 * time.Minute // time before we give up an account check lock StuckNotificationCheckInterval = 2 * time.Minute // time between stuck notification checks StaleTokenThreshold = 2 * time.Hour // time an oauth token has to be expired for to be stale