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

Average processing time calculated incorrectly #1151

Closed
jadamcrain opened this issue Nov 2, 2023 · 5 comments
Closed

Average processing time calculated incorrectly #1151

jadamcrain opened this issue Nov 2, 2023 · 5 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@jadamcrain
Copy link
Contributor

Observed behavior

It always divides by 2, but it should divide by the number of requests served:

stats.average_processing_time = stats.processing_time.checked_div(2).unwrap();

I believe this should be:

stats.average_processing_time = stats.processing_time.checked_div(stats.requests).unwrap();

Expected behavior

The avg time should total time / # requests

Server and client version

current tip of main

Host environment

No response

Steps to reproduce

No response

@jadamcrain jadamcrain added the defect Suspected defect such as a bug or regression label Nov 2, 2023
@jadamcrain
Copy link
Contributor Author

If the endpoint returns total requests and total time it seems like the CLI should calculate the average?

Then every language implementation wouldn't have to do it since it's a "derived quantity" for the underlying data.

@Jarema
Copy link
Member

Jarema commented Nov 2, 2023

oh, that is a silly mistake.
Will issue a fix shortly, unless you want to contribute it 🙂

@jadamcrain
Copy link
Contributor Author

I'll do it just to get a PR, why not.

@jadamcrain
Copy link
Contributor Author

PR in #1152

@Jarema
Copy link
Member

Jarema commented Nov 2, 2023

Fixed in #1152

Thank you @jadamcrain !

@Jarema Jarema closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

2 participants