Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
f0ssel merged 4 commits intomainfromf0ssel/move-batchers
Jun 10, 2024

Conversation

f0ssel
Copy link
Contributor

@f0sself0ssel commentedMay 30, 2024
edited
Loading

This moves thebatchstats.Batcher andworkspaceusage.Tracker into theworkspacestats package to keep all updates tolast_used_at inside the same package. There are no functional changes in this PR.

Comment on lines 27 to 29
type StatsBatcher interface {
Add(now time.Time, agentID uuid.UUID, templateID uuid.UUID, userID uuid.UUID, workspaceID uuid.UUID, st *agentproto.Stats) error
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why do we have this interface and the batcher?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There's a test implementation athttps://github.com/coder/coder/blob/f0ssel/move-batchers/coderd/agentapi/stats_test.go#L30. That being said, there's a duplicate definition of this interface athttps://github.com/coder/coder/blob/f0ssel/move-batchers/coderd/agentapi/stats.go#L19 that can be removed.

Comment on lines +871 to +874
batcher, closeBatcher, err :=workspacestats.NewBatcher(ctx,
workspacestats.BatcherWithLogger(options.Logger.Named("batchstats")),
workspacestats.BatcherWithStore(options.Database),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm not particularly married to the functional opts here if you want to use a more conventional opts struct instead or just straight-up function args.

@github-actionsgithub-actionsbot added the staleThis issue is like stale bread. labelJun 8, 2024
@f0sself0sselforce-pushed thef0ssel/move-batchers branch frome2b56ec to9295149CompareJune 10, 2024 18:49
@f0sself0ssel removed the staleThis issue is like stale bread. labelJun 10, 2024
@f0sself0ssel merged commit5b9a65e intomainJun 10, 2024
30 checks passed
@f0sself0ssel deleted the f0ssel/move-batchers branchJune 10, 2024 19:35
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsJun 10, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@kylecarbskylecarbskylecarbs left review comments

@johnstcnjohnstcnjohnstcn approved these changes

Assignees

@f0sself0ssel

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@f0ssel@johnstcn@kylecarbs

[8]ページ先頭

©2009-2025 Movatter.jp