Average processing time calculated incorrectly
jadamcrain opened this issue · comments
Observed behavior
It always divides by 2, but it should divide by the number of requests served:
nats.rs/async-nats/src/service/mod.rs
Line 787 in 67b2798
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
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.
oh, that is a silly mistake.
Will issue a fix shortly, unless you want to contribute it 🙂
I'll do it just to get a PR, why not.
PR in #1152
Fixed in #1152
Thank you @jadamcrain !