-
Notifications
You must be signed in to change notification settings - Fork 1
/
Stats.ts
35 lines (27 loc) · 862 Bytes
/
Stats.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Mean } from './Mean';
import { StandardDeviation as Std } from './StandardDeviation';
import { Count } from './Count';
import { Maximum as Max } from './Maximum';
import { Minimum as Min } from './Minimum';
/**
* The stats resultant of running a test
*/
export class Stats {
readonly mean: number;
readonly std: number;
readonly count: number;
readonly max: number;
readonly min: number;
/**
* Constructor
*
* @param cycleTimes list of obtained performance times of each cycle
*/
constructor(cycleTimes: Array<number>) {
this.mean = new Mean().calculate(cycleTimes);
this.std = new Std().calculate(cycleTimes);
this.count = new Count().calculate(cycleTimes);
this.max = new Max().calculate(cycleTimes);
this.min = new Min().calculate(cycleTimes);
}
}