Skip to content

[management] push benchmark results to grafana #3701

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 9 commits into from
Apr 17, 2025

Conversation

pascal-fischer
Copy link
Collaborator

Describe your changes

Issue ticket number and link

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@Copilot Copilot AI review requested due to automatic review settings April 17, 2025 15:37
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances benchmark reporting by pushing benchmark results to Grafana via Prometheus metrics while updating benchmark tests to run only in CI. Key changes include:

  • Adding a Prometheus gauge vector (benchmarkDuration) and integrating it within EvaluateBenchmarkResults.
  • Removing local performance thresholds in favor of external metric push.
  • Updating benchmark tests and CI pipelines to ensure proper CI environment variables and service initialization.

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
management/server/http/testing/testing_tools/tools.go Introduces Prometheus metric gauge and modifies EvaluateBenchmarkResults to use metric push.
management/server/http/testing/benchmarks/users_handler_benchmark_test.go Updates benchmark tests for users and adds CI skipping.
management/server/http/testing/benchmarks/setupkeys_handler_benchmark_test.go Updates benchmark tests for setup keys and adds CI skipping.
management/server/http/testing/benchmarks/peers_handler_benchmark_test.go Updates benchmark tests for peers and adds CI skipping.
.github/workflows/golang-test-linux.yml Configures CI environment and starts Prometheus and Pushgateway services for benchmarking.
Files not reviewed (1)
  • go.mod: Language not supported
Comments suppressed due to low confidence (2)

management/server/http/testing/testing_tools/tools.go:345

  • Consider externalizing the Pushgateway URL (currently hard-coded as 'http://localhost:9091') to an environment variable, so the configuration becomes more flexible and environment agnostic.
if err := push.New("http://localhost:9091", "api_benchmark").Collector(benchmarkDuration).Push(); err != nil {

management/server/http/testing/testing_tools/tools.go:327

  • [nitpick] The parameter 'testCase' is passed a variable named 'name' from the tests; consider renaming it (for example, to 'benchmarkCase') to ensure consistent and clear naming across the codebase.
func EvaluateBenchmarkResults(b *testing.B, testCase string, duration time.Duration, recorder *httptest.ResponseRecorder, module string, operation string) {

lixmal
lixmal previously approved these changes Apr 17, 2025
@pascal-fischer pascal-fischer requested a review from lixmal April 17, 2025 18:54
@pascal-fischer pascal-fischer merged commit a4311f5 into main Apr 17, 2025
34 of 35 checks passed
@pascal-fischer pascal-fischer deleted the chore/push-benchmarks-to-grafana branch April 17, 2025 19:01
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