File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ # This file adds a new "Steady State" results (working set and cpu) to the "application" job.
2+ # It uses all the measurements after the warmup is done.
3+
4+ results :
5+
6+ - name : benchmarks/working-set/steady
7+ description : Load Working Set - P90 (MB)
8+ format : n0
9+
10+ - name : benchmarks/cpu/steady
11+ description : Load CPU Usage - P90 (%)
12+ format : n0
13+
14+ onResultsCreating :
15+ - |
16+
17+ function steadyState(measurement, reduce) {
18+ // Calculates the result of the 'reduce' operation on the 'measurement' property of the application job.
19+ // example:
20+ // const result = steadyState('benchmarks/working-set', percentile90);
21+
22+ let duration = benchmarks.jobs.load.variables.duration;
23+ let measurements = benchmarks.jobs.application.measurements[0].filter(m => m.name == measurement);
24+
25+ // Don't add any result if there are no measurements
26+ if (measurements.length == 0) {
27+ console.warn(`No measurements available for '${measurement}'.`);
28+ return null;
29+ }
30+
31+ let lastMeasurement = measurements[measurements.length-1];
32+ let begin = new Date(lastMeasurement.timestamp) - duration * 1000;
33+ let recent = measurements.filter(m => new Date(m.timestamp) >= begin);
34+ let values = recent.map(m => m.value);
35+ let result = reduce(values);
36+
37+ return result;
38+ }
39+
40+ onResultsCreated :
41+ - |
42+ benchmarks.jobs.application.results["benchmarks/working-set/steady"] = steadyState('benchmarks/working-set', percentile90);
43+ benchmarks.jobs.application.results["benchmarks/cpu/steady"] = steadyState('benchmarks/cpu', percentile90);
You can’t perform that action at this time.
0 commit comments