Add CPS limit to the plots 92/138892/4
authorhalil.cakal <halil.cakal@est.tech>
Tue, 3 Sep 2024 14:38:01 +0000 (15:38 +0100)
committerhalil.cakal <halil.cakal@est.tech>
Fri, 13 Sep 2024 08:46:13 +0000 (09:46 +0100)
- as of now the cps limits given manually according to
  the latest result
- there will be another commit will change the plot
  job in cicd repo to reflect the values on the plots

Issue-ID: CPS-2350

Change-Id: Ic371f46894f1825dca1d26ec65ae0f62aa06c327
Signed-off-by: halil.cakal <halil.cakal@est.tech>
k6-tests/ncmp/common/utils.js

index 5d19056..8ee6d10 100644 (file)
@@ -81,27 +81,27 @@ export function performGetRequest(url, metricTag) {
     return http.get(url, {tags: metricTags});
 }
 
-export function makeCustomSummaryReport(data, options) {
+export function makeCustomSummaryReport(testResults, scenarioConfig) {
     const summaryCsvLines = [
-        '#,Test Name,Unit,Limit,Actual',
-        makeSummaryCsvLine('0', 'HTTP request failures for all tests', 'rate of failed requests', 'http_req_failed', data, options),
-        makeSummaryCsvLine('1', 'Registration of CM-handles', 'CM-handles/second', 'cmhandles_created_per_second', data, options),
-        makeSummaryCsvLine('2', 'De-registration of CM-handles', 'CM-handles/second', 'cmhandles_deleted_per_second', data, options),
-        makeSummaryCsvLine('3', 'CM-handle ID search with Module and Property filter', 'milliseconds', 'id_search_duration', data, options),
-        makeSummaryCsvLine('4', 'CM-handle search with Module and Property filter', 'milliseconds', 'cm_search_duration', data, options),
-        makeSummaryCsvLine('5a', 'NCMP overhead for Synchronous single CM-handle pass-through read', 'milliseconds', 'ncmp_overhead_passthrough_read', data, options),
-        makeSummaryCsvLine('5b', 'NCMP overhead for Synchronous single CM-handle pass-through read with alternate id', 'milliseconds', 'ncmp_overhead_passthrough_read_alt_id', data, options),
-        makeSummaryCsvLine('6a', 'NCMP overhead for Synchronous single CM-handle pass-through write', 'milliseconds', 'ncmp_overhead_passthrough_write', data, options),
-        makeSummaryCsvLine('6b', 'NCMP overhead for Synchronous single CM-handle pass-through write with alternate id', 'milliseconds', 'ncmp_overhead_passthrough_write_alt_id', data, options),
-        makeSummaryCsvLine('7', 'Legacy batch read operation', 'events/second', 'legacy_batch_read_cmhandles_per_second', data, options),
+        '#,Test Name,Unit,Fs Requirement,Current Expectation,Actual',
+        makeSummaryCsvLine('0', 'HTTP request failures for all tests', 'rate of failed requests', 'http_req_failed', 0, testResults, scenarioConfig),
+        makeSummaryCsvLine('1', 'Registration of CM-handles', 'CM-handles/second', 'cmhandles_created_per_second', 110, testResults, scenarioConfig),
+        makeSummaryCsvLine('2', 'De-registration of CM-handles', 'CM-handles/second', 'cmhandles_deleted_per_second', 80, testResults, scenarioConfig),
+        makeSummaryCsvLine('3', 'CM-handle ID search with Module and Property filter', 'milliseconds', 'id_search_duration', 4000, testResults, scenarioConfig),
+        makeSummaryCsvLine('4', 'CM-handle search with Module and Property filter', 'milliseconds', 'cm_search_duration', 30000, testResults, scenarioConfig),
+        makeSummaryCsvLine('5a', 'NCMP overhead for Synchronous single CM-handle pass-through read', 'milliseconds', 'ncmp_overhead_passthrough_read', 40, testResults, scenarioConfig),
+        makeSummaryCsvLine('5b', 'NCMP overhead for Synchronous single CM-handle pass-through read with alternate id', 'milliseconds', 'ncmp_overhead_passthrough_read_alt_id', 60, testResults, scenarioConfig),
+        makeSummaryCsvLine('6a', 'NCMP overhead for Synchronous single CM-handle pass-through write', 'milliseconds', 'ncmp_overhead_passthrough_write', 30, testResults, scenarioConfig),
+        makeSummaryCsvLine('6b', 'NCMP overhead for Synchronous single CM-handle pass-through write with alternate id', 'milliseconds', 'ncmp_overhead_passthrough_write_alt_id', 60, testResults, scenarioConfig),
+        makeSummaryCsvLine('7', 'Legacy batch read operation', 'events/second', 'legacy_batch_read_cmhandles_per_second', 1100, testResults, scenarioConfig),
     ];
     return summaryCsvLines.join('\n') + '\n';
 }
 
-function makeSummaryCsvLine(testCase, testName, unit, thresholdInK6, data, options) {
-    const thresholdArray = JSON.parse(JSON.stringify(options.thresholds[thresholdInK6]));
+function makeSummaryCsvLine(testCase, testName, unit, measurementName, currentExpectation, testResults, scenarioConfig) {
+    const thresholdArray = JSON.parse(JSON.stringify(scenarioConfig.thresholds[measurementName]));
     const thresholdString = thresholdArray[0];
     const [thresholdKey, thresholdOperator, thresholdValue] = thresholdString.split(/\s+/);
-    const actualValue = data.metrics[thresholdInK6].values[thresholdKey].toFixed(3);
-    return `${testCase},${testName},${unit},${thresholdValue},${actualValue}`;
+    const actualValue = testResults.metrics[measurementName].values[thresholdKey].toFixed(3);
+    return `${testCase},${testName},${unit},${thresholdValue},${currentExpectation},${actualValue}`;
 }