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

Method GetAndResetBoundaryUsageSummary

coderd/database/querier.go:315–315  ·  view source on GitHub ↗

Atomic read+delete prevents replicas that flush between a separate read and reset from having their data deleted before the next snapshot. Uses a common table expression with DELETE...RETURNING so the rows we sum are exactly the rows we delete. Stale rows are excluded from the sum but still deleted.

(ctx context.Context, maxStalenessMs int64)

Source from the content-addressed store, hash-verified

313 // table expression with DELETE...RETURNING so the rows we sum are exactly the
314 // rows we delete. Stale rows are excluded from the sum but still deleted.
315 GetAndResetBoundaryUsageSummary(ctx context.Context, maxStalenessMs int64) (GetAndResetBoundaryUsageSummaryRow, error)
316 GetAnnouncementBanners(ctx context.Context) (string, error)
317 GetApplicationName(ctx context.Context) (string, error)
318 // GetAuditLogsBefore retrieves `row_limit` number of audit logs before the provided

Implementers 5

sqlQueriercoderd/database/db.go
queryMetricsStorecoderd/database/dbmetrics/querymetrics
queriercoderd/database/dbauthz/dbauthz.go
MockStorecoderd/database/dbmock/dbmock.go
MockStoreMockRecordercoderd/database/dbmock/dbmock.go

Calls

no outgoing calls