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

Benchmarks middleware #22

Merged
merged 6 commits into from
May 15, 2022
Merged

Benchmarks middleware #22

merged 6 commits into from
May 15, 2022

Conversation

umputun
Copy link
Member

@umputun umputun commented May 15, 2022

The goal is to add a simple middleware collecting and reporting performance metrics of requests/responses. It keeps track of the response speed (average, min, and max) as well as request counts in 1s benchData buckets limiting the number of buckets
to maxTimeRange (900, for a max of 15 minutes).

Users can request the benchmark for any aggregated time duration, however, anything above maxTimeRange won't make any difference. This is intended to be used for retrieving the benchmark data for the last minute, 5 minutes, and up to 15m. Somewhat similar to how Linux reports load averages.

umputun added 3 commits May 15, 2022 15:35
this thing is collecting and reporting performance metrics, i.e. number of request, req/sec, max/min resp time and average resp time for a given (last) duration
@coveralls
Copy link

coveralls commented May 15, 2022

Pull Request Test Coverage Report for Build 2328494763

  • 83 of 85 (97.65%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.4%) to 87.518%

Changes Missing Coverage Covered Lines Changed/Added Lines %
benchmarks.go 83 85 97.65%
Totals Coverage Status
Change from base Build 2100690432: 1.4%
Covered Lines: 610
Relevant Lines: 697

💛 - Coveralls

@umputun
Copy link
Member Author

umputun commented May 15, 2022

@paskal could you pls review it? this is conceptually somewhat similar to the thing you did in the rlb-stats project

@umputun umputun merged commit 99f8598 into master May 15, 2022
@umputun umputun deleted the benchmarks branch May 15, 2022 23:20
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