lib/bench.js
function checkThresholds(metrics, thresholds) {
  if (!elv(thresholds)) return;

  const target = metrics[thresholds.target];

  for (let i = 0; i < metrics.length; i++) {
    if (i === thresholds.target) continue;

    const other = metrics[i];
    assertThreshold(target.avg, other.avg, thresholds.avg);
    assertThreshold(target.max, other.max, thresholds.max);
    assertThreshold(target.min, other.min, thresholds.min);
  }
}
function checkThresholds(metrics, thresholds) {
  if (!elv(thresholds)) return;

  const target = metrics[thresholds.target];

  for (let i = 0; i < metrics.length; i++) {
    if (i === thresholds.target) continue;

    const other = metrics[i];
    assertThreshold(target.avg, other.avg, thresholds.avg);
    assertThreshold(target.max, other.max, thresholds.max);
    assertThreshold(target.min, other.min, thresholds.min);
  }
}
function checkThresholds ( metrics , thresholds ) { if ( ! elv ( thresholds ) ) return ; const target = metrics [ thresholds . target ] ; for ( let i = 0 ; i < metrics . length ; i ++ ) { if ( i === thresholds . target ) continue ; const other = metrics [ i ] ; assertThreshold ( target . avg , other . avg , thresholds . avg ) ; assertThreshold ( target . max , other . max , thresholds . max ) ; assertThreshold ( target . min , other . min , thresholds . min ) ; } }
Validates results of a benchmarking run against a given set of thresholds. If
the target function's metrics are outside of the given thresholds, an error
is thrown.

@param {FunctionMetrics[]} metrics
@param {Thresholds} thresholds
Validates results of a benchmarking run against a given set of thresholds . If the target function s metrics are outside of the given thresholds an error is thrown .