@oino-ts/types 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/src/OINOBenchmark.d.ts +45 -12
- package/package.json +1 -1
|
@@ -30,15 +30,15 @@ export declare abstract class OINOBenchmark {
|
|
|
30
30
|
* @param modules array of those benchmarks that are enabled
|
|
31
31
|
*/
|
|
32
32
|
static setEnabled(modules: string[]): void;
|
|
33
|
-
protected abstract
|
|
33
|
+
protected abstract _startMetric(module: string, method: string): void;
|
|
34
34
|
/**
|
|
35
35
|
* Start benchmark timing.
|
|
36
36
|
*
|
|
37
37
|
* @param module of the benchmark
|
|
38
38
|
* @param method of the benchmark
|
|
39
39
|
*/
|
|
40
|
-
static
|
|
41
|
-
protected abstract
|
|
40
|
+
static startMetric(module: string, method: string): void;
|
|
41
|
+
protected abstract _endMetric(module: string, method: string, category: string): void;
|
|
42
42
|
/**
|
|
43
43
|
* Complete benchmark timing
|
|
44
44
|
*
|
|
@@ -46,8 +46,8 @@ export declare abstract class OINOBenchmark {
|
|
|
46
46
|
* @param method of the benchmark
|
|
47
47
|
* @param category optional subcategory of the benchmark
|
|
48
48
|
*/
|
|
49
|
-
static
|
|
50
|
-
protected abstract
|
|
49
|
+
static endMetric(module: string, method: string, category?: string): void;
|
|
50
|
+
protected abstract _getMetric(module: string, method: string): number;
|
|
51
51
|
/**
|
|
52
52
|
* Get given benchmark data.
|
|
53
53
|
*
|
|
@@ -55,13 +55,42 @@ export declare abstract class OINOBenchmark {
|
|
|
55
55
|
* @param method of the benchmark
|
|
56
56
|
*
|
|
57
57
|
*/
|
|
58
|
-
static
|
|
59
|
-
protected abstract
|
|
58
|
+
static getMetric(module: string, method: string): number;
|
|
59
|
+
protected abstract _getMetrics(): Record<string, number>;
|
|
60
60
|
/**
|
|
61
61
|
* Get all benchmark data.
|
|
62
62
|
*
|
|
63
63
|
*/
|
|
64
|
-
static
|
|
64
|
+
static getMetrics(): Record<string, number>;
|
|
65
|
+
protected abstract _trackMetric(module: string, method: string, category: string, value: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* Track a metric value
|
|
68
|
+
*
|
|
69
|
+
* @param value of the metric
|
|
70
|
+
* @param module of the metric
|
|
71
|
+
* @param method of the metric
|
|
72
|
+
* @param category optional subcategory of the metric
|
|
73
|
+
*
|
|
74
|
+
*/
|
|
75
|
+
static trackMetric(module: string, method: string, category: string, value: number): void;
|
|
76
|
+
protected abstract _trackException(module: string, method: string, category: string, name: string, message: string, stack: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Track an exception
|
|
79
|
+
*
|
|
80
|
+
* @param module of the benchmark
|
|
81
|
+
* @param method of the benchmark
|
|
82
|
+
* @param category optional subcategory of the benchmark
|
|
83
|
+
* @param name of the exception
|
|
84
|
+
* @param message of the exception
|
|
85
|
+
* @param stack trace of the exception
|
|
86
|
+
*/
|
|
87
|
+
static trackException(module: string, method: string, category: string, name: string, message: string, stack: string): void;
|
|
88
|
+
protected abstract _getExceptions(): any[];
|
|
89
|
+
/**
|
|
90
|
+
* Get all tracked exceptions.
|
|
91
|
+
*
|
|
92
|
+
*/
|
|
93
|
+
static getExceptions(): any[];
|
|
65
94
|
}
|
|
66
95
|
/**
|
|
67
96
|
* OINOMemoryBenchmark is a memory-based benchmark implementation.
|
|
@@ -72,6 +101,7 @@ export declare class OINOMemoryBenchmark extends OINOBenchmark {
|
|
|
72
101
|
protected _benchmarkCount: Record<string, number>;
|
|
73
102
|
protected _benchmarkData: Record<string, number>;
|
|
74
103
|
protected _benchmarkStart: Record<string, number>;
|
|
104
|
+
protected _exceptions: any[];
|
|
75
105
|
/**
|
|
76
106
|
* Reset benchmark data (but not what is enabled).
|
|
77
107
|
*
|
|
@@ -83,7 +113,7 @@ export declare class OINOMemoryBenchmark extends OINOBenchmark {
|
|
|
83
113
|
* @param module of the benchmark
|
|
84
114
|
* @param method of the benchmark
|
|
85
115
|
*/
|
|
86
|
-
protected
|
|
116
|
+
protected _startMetric(module: string, method: string): void;
|
|
87
117
|
/**
|
|
88
118
|
* Complete benchmark timing
|
|
89
119
|
*
|
|
@@ -91,7 +121,7 @@ export declare class OINOMemoryBenchmark extends OINOBenchmark {
|
|
|
91
121
|
* @param method of the benchmark
|
|
92
122
|
* @param category optional subcategory of the benchmark
|
|
93
123
|
*/
|
|
94
|
-
protected
|
|
124
|
+
protected _endMetric(module: string, method: string, category: string): void;
|
|
95
125
|
/**
|
|
96
126
|
* Get given benchmark data.
|
|
97
127
|
*
|
|
@@ -99,10 +129,13 @@ export declare class OINOMemoryBenchmark extends OINOBenchmark {
|
|
|
99
129
|
* @param method of the benchmark
|
|
100
130
|
*
|
|
101
131
|
*/
|
|
102
|
-
protected
|
|
132
|
+
protected _getMetric(module: string, method: string): number;
|
|
103
133
|
/**
|
|
104
134
|
* Get all benchmark data.
|
|
105
135
|
*
|
|
106
136
|
*/
|
|
107
|
-
protected
|
|
137
|
+
protected _getMetrics(): Record<string, number>;
|
|
138
|
+
protected _trackMetric(module: string, method: string, category: string, value: number): void;
|
|
139
|
+
protected _trackException(module: string, method: string, category: string, name: string, message: string, stack: string): void;
|
|
140
|
+
protected _getExceptions(): any[];
|
|
108
141
|
}
|