f1 icon indicating copy to clipboard operation
f1 copied to clipboard

Possible rate calculation issue

Open martinreus-form3 opened this issue 4 years ago • 1 comments

While creating some test run scenarios for f1 defining constant rates, I found out that the calculated rate does not entirely work as expected; This was primarily discovered while creating f1-jobs ran in our staging env. Still need confirmation if coding a simple scenario locally would yield the same result (will do this once I have some time and open an example PR)

Example cases:

  • Constant rate of 1/300ms does not work at all
  • Constant rate of 1/215ms results in precisely 5TPS, when it should yield approx. 4.65. Additionally, setting rate to 1/299ms results in the same 5 TPS.

martinreus-form3 avatar Jul 30 '21 16:07 martinreus-form3

Constant rate of 1/300ms does not work at all

This appear to be coming from rounding error. PR https://github.com/form3tech-oss/f1/pull/88 attempts to address it, by introducing float comparison tolerance.

Constant rate of 1/215ms results in precisely 5TPS, when it should yield approx. 4.65. Additionally, setting rate to 1/299ms results in the same 5 TPS.

This seems to be intended by design, based on the code. The "regular" distribution has a fixed resolution of 100 ms, and therefore iteration duration is rounded down to 100 ms. As a result 200ms, 215ms, and 299ms are essentially the same thing.

pippo avatar Oct 24 '21 21:10 pippo

Fixed by #141

nvloff-f3 avatar Jun 11 '24 08:06 nvloff-f3