Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/merlin/deps.ts>pretty_benching.calculateThresholds

Testing and Benchmarking framework for deno 🧙‍♂️
Latest
function pretty_benching.calculateThresholds
import { pretty_benching } from "https://deno.land/x/merlin@v1.0.7/deps.ts";
const { calculateThresholds } = pretty_benching;

Calculates Thresholds from the historic data for each benchmark.

EXPERIMENTAL The default way of calculating may change, if you relay on thresholds provide your calculation so it wont change unexpectedly

The default way the thresholds are calculated:

  • only calculate threshold for benchmark, which has at least 5 previous runs
  • green is the (minimum of the measured measuredRunsAvgMs) * 1.1
  • yellow is the (maximum of the measured measuredRunsAvgMs) * 1.2

This can be overridden with the options.

Parameters

optional
options: { minProceedingRuns?: number; calculate?: (runs: BenchmarkHistoryItem<T, K>[]) => Threshold; }