8000 chore: move Batcher and Tracker to workspacestats by f0ssel · Pull Request #13418 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore: move Batcher and Tracker to workspacestats #13418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Fa 8000 iled to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove duplicate interface
  • Loading branch information
f0ssel committed Jun 10, 2024
commit efed3bc0a5efe705916d2e24ee78ab15303a533b
6 changes: 0 additions & 6 deletions coderd/agentapi/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,13 @@ import (
"golang.org/x/xerrors"
"google.golang.org/protobuf/types/known/durationpb"

"github.com/google/uuid"

"cdr.dev/slog"
agentproto "github.com/coder/coder/v2/agent/proto"
"github.com/coder/coder/v2/coderd/database"
"github.com/coder/coder/v2/coderd/database/dbtime"
"github.com/coder/coder/v2/coderd/workspacestats"
)

type StatsBatcher interface {
Add(now time.Time, agentID uuid.UUID, templateID uuid.UUID, userID uuid.UUID, workspaceID uuid.UUID, st *agentproto.Stats) error
}

type StatsAPI struct {
AgentFn func(context.Context) (database.WorkspaceAgent, error)
Database database.Store
Expand Down
2 changes: 1 addition & 1 deletion coderd/agentapi/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type statsBatcher struct {
lastStats *agentproto.Stats
}

var _ agentapi.StatsBatcher = &statsBatcher{}
var _ workspacestats.StatsBatcher = &statsBatcher{}

func (b *statsBatcher) Add(now time.Time, agentID uuid.UUID, templateID uuid.UUID, userID uuid.UUID, workspaceID uuid.UUID, st *agentproto.Stats) error {
b.mu.Lock()
Expand Down
0