forked from as-pect/as-pect
-
Notifications
You must be signed in to change notification settings - Fork 1
/
IPerformanceConfiguration.ts
53 lines (52 loc) 路 1.91 KB
/
IPerformanceConfiguration.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* This is the interface for performance configuration provided to the TestContext object, before
* tests are run.
*/
export interface IPerformanceConfiguration {
[key: string]: number | boolean;
/** Enable performance statistics gathering. */
enabled: boolean;
/** Set the minimum number of samples to run for each test in milliseconds. */
maxSamples: number;
/** Set the maximum test run time in milliseconds. */
maxTestRunTime: number;
/** Report the median time in the default reporter. */
reportMedian: boolean;
/** Report the average time in milliseconds. */
reportAverage: boolean;
/** Report the standard deviation. */
reportStandardDeviation: boolean;
/** Report the maximum run time in milliseconds. */
reportMax: boolean;
/** Report the minimum run time in milliseconds. */
reportMin: boolean;
/** Report the variance. */
reportVariance: boolean;
/** Set the number of decimal places to round to. */
roundDecimalPlaces: number;
}
/** This method creates a default performance configuration. */
export function createDefaultPerformanceConfiguration(): IPerformanceConfiguration {
return {
/** Enable performance statistics gathering for each test. */
enabled: false,
/** Set the maximum number of samples to run for each test. */
maxSamples: 10000,
/** Set the maximum test run time in milliseconds. */
maxTestRunTime: 2000,
/** Set the number of decimal places to round to. */
roundDecimalPlaces: 3,
/** Report the median time in the default reporter. */
reportMedian: true,
/** Report the average time in milliseconds. */
reportAverage: true,
/** Report the standard deviation. */
reportStandardDeviation: false,
/** Report the maximum run time in milliseconds. */
reportMax: false,
/** Report the minimum run time in milliseconds. */
reportMin: false,
/** Report the variance/ */
reportVariance: false,
};
}