MCPcopy Index your code
hub / github.com/coder/coder / TryAcquireLock

Method TryAcquireLock

coderd/database/dbmetrics/querymetrics.go:4685–4691  ·  view source on GitHub ↗
(ctx context.Context, pgTryAdvisoryXactLock int64)

Source from the content-addressed store, hash-verified

4683}
4684
4685func (m queryMetricsStore) TryAcquireLock(ctx context.Context, pgTryAdvisoryXactLock int64) (bool, error) {
4686 start := time.Now()
4687 r0, r1 := m.s.TryAcquireLock(ctx, pgTryAdvisoryXactLock)
4688 m.queryLatencies.WithLabelValues("TryAcquireLock").Observe(time.Since(start).Seconds())
4689 m.queryCounts.WithLabelValues(httpmw.ExtractHTTPRoute(ctx), httpmw.ExtractHTTPMethod(ctx), "TryAcquireLock").Inc()
4690 return r0, r1
4691}
4692
4693func (m queryMetricsStore) UnarchiveChatByID(ctx context.Context, id uuid.UUID) ([]database.Chat, error) {
4694 start := time.Now()

Callers

nothing calls this directly

Calls 4

ExtractHTTPRouteFunction · 0.92
ExtractHTTPMethodFunction · 0.92
WithLabelValuesMethod · 0.80
TryAcquireLockMethod · 0.65

Tested by

no test coverage detected