Skip to content

Commit ad7f470

Browse files
committed
Only measure dispatch time
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 093e86b commit ad7f470

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

coderd/notifications/notifier.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ func (n *notifier) deliver(ctx context.Context, msg database.AcquireNotification
210210

211211
start := time.Now()
212212
retryable, err := deliver(ctx, msg.ID)
213+
n.metrics.DispatcherSendSeconds.WithLabelValues(string(n.method)).Observe(time.Since(start).Seconds())
214+
213215
if err != nil {
214216
// Don't try to accumulate message responses if the context has been canceled.
215217
//
@@ -241,7 +243,6 @@ func (n *notifier) deliver(ctx context.Context, msg database.AcquireNotification
241243
success <- n.newSuccessfulDispatch(msg)
242244
}
243245
}
244-
n.metrics.DispatcherSendSeconds.WithLabelValues(string(n.method)).Observe(time.Since(start).Seconds())
245246
n.metrics.PendingUpdates.Set(float64(len(success) + len(failure)))
246247

247248
return nil

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy