diff --git a/docs/api/index.md b/docs/api/index.md index 6c8f36f76..587defd58 100644 --- a/docs/api/index.md +++ b/docs/api/index.md @@ -514,6 +514,119 @@ export interface Options { teardown?: Hook } ``` +After the test case is run, the output structure information is as follows: + +``` + name hz min max mean p75 p99 p995 p999 rme samples +· normal sorting 6,526,368.12 0.0001 0.3638 0.0002 0.0002 0.0002 0.0002 0.0004 ±1.41% 652638 +``` +```ts +export interface TaskResult { + /* + * the last error that was thrown while running the task + */ + error?: unknown + + /** + * The amount of time in milliseconds to run the benchmark task (cycle). + */ + totalTime: number + + /** + * the minimum value in the samples + */ + min: number + /** + * the maximum value in the samples + */ + max: number + + /** + * the number of operations per second + */ + hz: number + + /** + * how long each operation takes (ms) + */ + period: number + + /** + * task samples of each task iteration time (ms) + */ + samples: number[] + + /** + * samples mean/average (estimate of the population mean) + */ + mean: number + + /** + * samples variance (estimate of the population variance) + */ + variance: number + + /** + * samples standard deviation (estimate of the population standard deviation) + */ + sd: number + + /** + * standard error of the mean (a.k.a. the standard deviation of the sampling distribution of the sample mean) + */ + sem: number + + /** + * degrees of freedom + */ + df: number + + /** + * critical value of the samples + */ + critical: number + + /** + * margin of error + */ + moe: number + + /** + * relative margin of error + */ + rme: number + + /** + * median absolute deviation + */ + mad: number + + /** + * p50/median percentile + */ + p50: number + + /** + * p75 percentile + */ + p75: number + + /** + * p99 percentile + */ + p99: number + + /** + * p995 percentile + */ + p995: number + + /** + * p999 percentile + */ + p999: number +} +``` ### bench.skip