From c13fc147080dff28644d7145a96f3020533099eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 3 Oct 2024 18:02:54 +0200 Subject: [PATCH] refactor(reporter): simplify iters std dev computation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/reporter/json/bmf.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/reporter/json/bmf.js b/src/reporter/json/bmf.js index b03eac7..a22616b 100644 --- a/src/reporter/json/bmf.js +++ b/src/reporter/json/bmf.js @@ -1,10 +1,9 @@ -import { ratioStandardDeviation } from '../../stats-utils.js' - export const bmf = report => { return report.benchmarks .filter(benchmark => benchmark.error == null) .map(({ name, stats }) => { - const throughputSd = ratioStandardDeviation(1e9, 0, stats?.avg, stats?.sd) + // https://en.wikipedia.org/wiki/Propagation_of_uncertainty#Example_formulae + const throughputSd = (1e9 * stats?.sd) / stats?.avg ** 2 return { [name]: { latency: {