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 benchmark for each collector #744

Merged
merged 1 commit into from
Apr 1, 2021
Merged

Add benchmark for each collector #744

merged 1 commit into from
Apr 1, 2021

Conversation

breed808
Copy link
Contributor

@breed808 breed808 commented Mar 7, 2021

Benchmarks will allow for easier identification of slow collectors.
Additionally, they increase test coverage of the collectors, with some
collectors now reaching 80-95% coverage with this change.

Collector benchmarks have been structed so that common functionality is
present in collector/collector_test.go as is done with non-test
functionality in collector/collector.go.
Test logic that is specific to individual collectors is present in the
collector test file (E.G. collector/process_test.go for the Process
collector).

Signed-off-by: Ben Reedy [email protected]

@breed808 breed808 requested a review from a team as a code owner March 7, 2021 01:05
@carlpett
Copy link
Collaborator

Looks good from a code point of view, just wondering if we would intend to run these as part of CI or more ad-hoc?

@breed808
Copy link
Contributor Author

My intention was for these to be run in an ad-hoc manner, primarily to detect slow collectors.

We could integrate these into the CI with cob. If you're interested I can get that working too.

@carlpett
Copy link
Collaborator

I think having them available for ad-hoc usage is sufficient for now. The build agents don't have all the services installed anyway.

Benchmarks will allow for easier identification of slow collectors.
Additionally, they increase test coverage of the collectors, with some
collectors now reaching 80-95% coverage with this change.

Collector benchmarks have been structed so that common functionality is
present in `collector/collector_test.go` as is done with non-test
functionality in `collector/collector.go`.
Test logic that is specific to individual collectors is present in the
collector test file (E.G. `collector/process_test.go` for the Process
collector).

Signed-off-by: Ben Reedy <[email protected]>
@breed808
Copy link
Contributor Author

breed808 commented Apr 1, 2021

FYI I've rebased this to resolve the merge conflicts introduced by #702. There's no functional difference in the change so I'll proceed with the merge.

@breed808 breed808 merged commit db00553 into prometheus-community:master Apr 1, 2021
@breed808 breed808 deleted the tests branch April 1, 2021 12:35
anubhavg-icpl pushed a commit to anubhavg-icpl/windows_exporter that referenced this pull request Sep 22, 2024
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.

2 participants