Skip to content

Commit 66b94e7

Browse files
committed
create alternative usage queries
1 parent c1bb5ab commit 66b94e7

File tree

11 files changed

+577
-4
lines changed

11 files changed

+577
-4
lines changed

coderd/database/dbauthz/dbauthz.go

+12
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,10 @@ func (q *querier) GetDeploymentWorkspaceAgentStats(ctx context.Context, createdA
14181418
return q.db.GetDeploymentWorkspaceAgentStats(ctx, createdAfter)
14191419
}
14201420

1421+
func (q *querier) GetDeploymentWorkspaceAgentUsageStats(ctx context.Context, createdAt time.Time) (database.GetDeploymentWorkspaceAgentUsageStatsRow, error) {
1422+
panic("not implemented")
1423+
}
1424+
14211425
func (q *querier) GetDeploymentWorkspaceStats(ctx context.Context) (database.GetDeploymentWorkspaceStatsRow, error) {
14221426
return q.db.GetDeploymentWorkspaceStats(ctx)
14231427
}
@@ -2360,6 +2364,14 @@ func (q *querier) GetWorkspaceAgentStatsAndLabels(ctx context.Context, createdAf
23602364
return q.db.GetWorkspaceAgentStatsAndLabels(ctx, createdAfter)
23612365
}
23622366

2367+
func (q *querier) GetWorkspaceAgentUsageStats(ctx context.Context, createdAt time.Time) ([]database.GetWorkspaceAgentUsageStatsRow, error) {
2368+
panic("not implemented")
2369+
}
2370+
2371+
func (q *querier) GetWorkspaceAgentUsageStatsAndLabels(ctx context.Context, createdAt time.Time) ([]database.GetWorkspaceAgentUsageStatsAndLabelsRow, error) {
2372+
panic("not implemented")
2373+
}
2374+
23632375
// GetWorkspaceAgentsByResourceIDs
23642376
// The workspace/job is already fetched.
23652377
func (q *querier) GetWorkspaceAgentsByResourceIDs(ctx context.Context, ids []uuid.UUID) ([]database.WorkspaceAgent, error) {

coderd/database/dbmem/dbmem.go

+12
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,10 @@ func (q *FakeQuerier) GetDeploymentWorkspaceAgentStats(_ context.Context, create
24322432
return stat, nil
24332433
}
24342434

2435+
func (q *FakeQuerier) GetDeploymentWorkspaceAgentUsageStats(ctx context.Context, createdAt time.Time) (database.GetDeploymentWorkspaceAgentUsageStatsRow, error) {
2436+
panic("not implemented")
2437+
}
2438+
24352439
func (q *FakeQuerier) GetDeploymentWorkspaceStats(ctx context.Context) (database.GetDeploymentWorkspaceStatsRow, error) {
24362440
q.mutex.RLock()
24372441
defer q.mutex.RUnlock()
@@ -5634,6 +5638,14 @@ func (q *FakeQuerier) GetWorkspaceAgentStatsAndLabels(ctx context.Context, creat
56345638
return stats, nil
56355639
}
56365640

5641+
func (q *FakeQuerier) GetWorkspaceAgentUsageStats(ctx context.Context, createdAt time.Time) ([]database.GetWorkspaceAgentUsageStatsRow, error) {
5642+
panic("not implemented")
5643+
}
5644+
5645+
func (q *FakeQuerier) GetWorkspaceAgentUsageStatsAndLabels(ctx context.Context, createdAt time.Time) ([]database.GetWorkspaceAgentUsageStatsAndLabelsRow, error) {
5646+
panic("not implemented")
5647+
}
5648+
56375649
func (q *FakeQuerier) GetWorkspaceAgentsByResourceIDs(ctx context.Context, resourceIDs []uuid.UUID) ([]database.WorkspaceAgent, error) {
56385650
q.mutex.RLock()
56395651
defer q.mutex.RUnlock()

coderd/database/dbmetrics/dbmetrics.go

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbmock/dbmock.go

+45
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dump.sql

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE workspace_agent_stats DROP COLUMN usage;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE workspace_agent_stats ADD COLUMN usage boolean NOT NULL DEFAULT false;

coderd/database/models.go

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/querier.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)