MCPcopy Create free account
hub / github.com/modem-dev/hunk / formatThresholdValue

Function formatThresholdValue

scripts/compare-release-benchmarks.ts:295–305  ·  view source on GitHub ↗
(value: number, unit: BenchmarkMetricResult["unit"])

Source from the content-addressed store, hash-verified

293}
294
295function formatThresholdValue(value: number, unit: BenchmarkMetricResult["unit"]) {
296 if (unit === "bytes") {
297 return `${formatNumber(value / (1024 * 1024))} MiB`;
298 }
299
300 if (unit === "ms") {
301 return `${formatNumber(value)} ms`;
302 }
303
304 return `${formatNumber(value)} ${formatUnit(unit)}`;
305}
306
307function formatThreshold(
308 threshold: BenchmarkThreshold | undefined,

Callers 1

formatThresholdFunction · 0.85

Calls 2

formatNumberFunction · 0.85
formatUnitFunction · 0.85

Tested by

no test coverage detected