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

Method GetTotalUsageDCManagedAgentsV1

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

Gets the total number of managed agents created between two dates. Uses the aggregate table to avoid large scans or a complex index on the usage_events table. This has the trade off that we can't count accurately between two exact timestamps. The provided timestamps will be converted to UTC and tru

(ctx context.Context, arg GetTotalUsageDCManagedAgentsV1Params)

Source from the content-addressed store, hash-verified

748 // the events that happened on and between the two dates. Both dates are
749 // inclusive.
750 GetTotalUsageDCManagedAgentsV1(ctx context.Context, arg GetTotalUsageDCManagedAgentsV1Params) (int64, error)
751 GetUnexpiredLicenses(ctx context.Context) ([]License, error)
752 GetUserAIProviderKeyByProviderID(ctx context.Context, arg GetUserAIProviderKeyByProviderIDParams) (UserAiProviderKey, error)
753 // GetUserAIProviderKeys is used by dbcrypt key rotation. Request paths should use

Callers 5

TestUsageEventsMethod · 0.65
EntitlementsFunction · 0.65
TestEntitlementsFunction · 0.65

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

Tested by 2

TestUsageEventsMethod · 0.52
TestEntitlementsFunction · 0.52