Skip to content
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

Add perf telemetry collection #165

Merged
merged 4 commits into from
Dec 7, 2023
Merged

Conversation

brycekahle
Copy link
Member

@brycekahle brycekahle commented Dec 5, 2023

What does this PR do?

Adds optional collection of perf (perf buffer and ring buffer) telemetry

Motivation

Simplifies consumption of the telemetry values from the users of ebpf-manager.

Additional Notes

Describe how to test your changes

if val <= oldVal {
return
}
if a.CompareAndSwap(oldVal, val) {
Copy link
Contributor

@hmahmood hmahmood Dec 5, 2023

Choose a reason for hiding this comment

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

Would we ever return false here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the point is that if another goroutine managed to update the value underneath, you don't make a change.

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't be possible based on the structure of other code, but this is the safe way to do it.

Copy link
Contributor

Choose a reason for hiding this comment

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

So we would try again in that case?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it would do the load, max check, and CAS again.

@brycekahle brycekahle merged commit 3a41ef4 into main Dec 7, 2023
3 checks passed
@brycekahle brycekahle deleted the bryce.kahle/perf-telemetry branch December 7, 2023 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants