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

Method AcquireLock

coderd/database/dbmetrics/querymetrics.go:117–123  ·  view source on GitHub ↗
(ctx context.Context, pgAdvisoryXactLock int64)

Source from the content-addressed store, hash-verified

115}
116
117func (m queryMetricsStore) AcquireLock(ctx context.Context, pgAdvisoryXactLock int64) error {
118 start := time.Now()
119 r0 := m.s.AcquireLock(ctx, pgAdvisoryXactLock)
120 m.queryLatencies.WithLabelValues("AcquireLock").Observe(time.Since(start).Seconds())
121 m.queryCounts.WithLabelValues(httpmw.ExtractHTTPRoute(ctx), httpmw.ExtractHTTPMethod(ctx), "AcquireLock").Inc()
122 return r0
123}
124
125func (m queryMetricsStore) AcquireNotificationMessages(ctx context.Context, arg database.AcquireNotificationMessagesParams) ([]database.AcquireNotificationMessagesRow, error) {
126 start := time.Now()

Callers

nothing calls this directly

Calls 4

ExtractHTTPRouteFunction · 0.92
ExtractHTTPMethodFunction · 0.92
WithLabelValuesMethod · 0.80
AcquireLockMethod · 0.65

Tested by

no test coverage detected