Skip to content

Commit

Permalink
docs(stats): ts api extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
lynchbomb committed Oct 1, 2021
1 parent 1f4faef commit d40fd21
Show file tree
Hide file tree
Showing 52 changed files with 3,068 additions and 35 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"husky": "^7.0.1",
"conventional-changelog-cli": "^2.1.1",
"@commitlint/config-conventional": "^12.1.4",
"@commitlint/cli": "^13.1.0"
"@commitlint/cli": "^13.1.0",
"@microsoft/api-extractor": "^7.18.11",
"@microsoft/api-documenter": "^7.13.54"
},
"repository": {
"type": "git",
Expand Down
24 changes: 14 additions & 10 deletions packages/stats/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![Build Status](https://travis-ci.org/TracerBench/tracerbench.svg?branch=master)](https://travis-ci.org/TracerBench/tracerbench)

## TracerBench

https://www.tracerbench.com/

### Installation
Expand All @@ -21,8 +22,8 @@ npm install --save @tracerbench/stats
const { Stats, convertMSToMicroseconds } = require('@tracerbench/stats');

// sample input (in MS)
const control = [ 1063, 2112, 1154, 988, 1066, 2111, 1097, 1062, 1033, 1017];
const experiment = [ 1063, 1092, 1088, 1030, 1089, 1047, 959, 1103, 1453, 1034];
const control = [1063, 2112, 1154, 988, 1066, 2111, 1097, 1062, 1033, 1017];
const experiment = [1063, 1092, 1088, 1030, 1089, 1047, 959, 1103, 1453, 1034];

const stats = new Stats({
// Ensure these are microseconds
Expand All @@ -33,16 +34,16 @@ const stats = new Stats({

// example output:

stats.name; // => 'My Experiment';
stats.controlMS; // => control input converted to ms
stats.experimentMS; // => experiment input converted to ms
stats.controlSortedMS; // => control input sorted + converted to ms
stats.name; // => 'My Experiment';
stats.controlMS; // => control input converted to ms
stats.experimentMS; // => experiment input converted to ms
stats.controlSortedMS; // => control input sorted + converted to ms
stats.experimentSortedMS; // => experiment input sorted + converted to ms
stats.sampleCount; // => {control: 10, experiment: 10}
stats.range; // => { min: 959, max: 2112 }
stats.sparkLine; // => {control: "█▁▁▁▁▁▁▁▁▁▂", experiment: "█▁▁▁▁▁▁▁▁▁▁"}
stats.sampleCount; // => {control: 10, experiment: 10}
stats.range; // => { min: 959, max: 2112 }
stats.sparkLine; // => {control: "█▁▁▁▁▁▁▁▁▁▂", experiment: "█▁▁▁▁▁▁▁▁▁▁"}
stats.confidenceInterval; // => {min: -46, max: 120, isSig: false}
stats.estimator; // => 9; the median difference between each input pairing (control vs experiment).
stats.estimator; // => 9; the median difference between each input pairing (control vs experiment).
stats.sevenFigureSummary; // => {
// control: {10: 1014, 25: 1040, 50: 1065, 75: 1140, 90: 2111, min: 988, max: 2112}
// experiment: {10: 1023, 25: 1037, 50: 1076, 75: 1091, 90: 1138, min: 959, max: 1453}
Expand All @@ -54,4 +55,7 @@ stats.outliers; // => {
```

# Statistics Primer

https://www.tracerbench.com/docs/guide/stats-primer

# Stats API

0 comments on commit d40fd21

Please sign in to comment.