Skip to content

feat: change agent to use v2 API for reporting stats #12024

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 1 commit into from
Feb 7, 2024

Conversation

spikecurtis
Copy link
Contributor

@spikecurtis spikecurtis commented Feb 6, 2024

Modifies the agent to use the v2 API to report its statistics, using the statsReporter subcomponent.

@spikecurtis spikecurtis marked this pull request as ready for review February 6, 2024 10:21
@spikecurtis spikecurtis force-pushed the spike/10534-report-stats branch 2 times, most recently from 3ac9064 to 204c103 Compare February 6, 2024 10:25
if req.Stats != nil {
f.statsCh <- req.Stats
}
return &agentproto.UpdateStatsResponse{ReportInterval: durationpb.New(statsInterval)}, nil
Copy link
Member

Choose a reason for hiding this comment

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

Does it mean that tests are time dependent on realstatsInterval? If so, it is possible to refactor them to use clock?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, they are, and yes, it's possible. But, I think that's outside the scope of this PR. I've just copied the hardcoded value from before into a const.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I assumed that it would be a low-hanging fruit to refactor, but I'm good with leaving for further.

Comment on lines -180 to +181
ok, s.ConnectionCount, s.RxBytes, s.TxBytes, s.SessionCountVSCode, s.ConnectionMedianLatencyMS)
ok, s.ConnectionCount, s.RxBytes, s.TxBytes, s.SessionCountVscode, s.ConnectionMedianLatencyMs)
Copy link
Member

Choose a reason for hiding this comment

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

VSCode vs Vscode
PTY vs Pty

are these renamed on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The SDK type fields were written by humans, the proto type fields are machine translated from lowercase_with_underscores so it doesn't get capitalization correct in all cases. Unfortunate from a style perspective, but I haven't chased down how to fix it yet.

Copy link
Member

@mtojek mtojek left a comment

Choose a reason for hiding this comment

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

LGTM

@spikecurtis spikecurtis force-pushed the spike/10534-report-stats branch from 9d29b4a to b850ab4 Compare February 7, 2024 11:14
@spikecurtis spikecurtis merged commit 1cf4b62 into main Feb 7, 2024
@spikecurtis spikecurtis deleted the spike/10534-report-stats branch February 7, 2024 11:26
Copy link
Contributor Author

Merge activity

@github-actions github-actions bot locked and limited conversation to collaborators Feb 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants