From 717a9b31540d2f65b494a519d5bb8a5db01c85d6 Mon Sep 17 00:00:00 2001 From: EESergey Date: Tue, 30 Jul 2024 11:07:47 +0200 Subject: [PATCH] scenarios: added terse output of results Signed-off-by: EESergey --- scenarios/grpc.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/scenarios/grpc.js b/scenarios/grpc.js index e731171..eef109b 100644 --- a/scenarios/grpc.js +++ b/scenarios/grpc.js @@ -163,3 +163,31 @@ export function uuidv4() { return v.toString(16); }); } + +export function handleSummary(data) { + const neo_ver = (__ENV.NEO_VER || 'Neo_ver_not_set'); + const test_type = (__ENV.TEST_TYPE || 'Test_type_not_set'); + const run_id = (__ENV.RUN_ID || 'Run_id_not_set'); + const test_id = (__ENV.TEST_ID || 'Test_id_not_set'); + const size_id = (__ENV.SIZE_ID || 'Size_id_not_set'); + const vu_qty = (__ENV.VU_QTY || 'Vu_qty_not_set'); + const host_id = (__ENV.HOST_ID || 'Host_id_not_set'); + const result_format = (__ENV.RESULT_FORMAT || 'not_set'); + const c1 = ~~((data.metrics.data_received.values.rate || '0')/1024/1024); + const c2 = ~~((data.metrics.data_sent.values.rate || '0')/1024/1024); + const c3 = ~~(data.metrics.neofs_obj_get_total && data.metrics.neofs_obj_get_total.values.rate || '0'); + const c4 = ~~(data.metrics.neofs_obj_get_duration && data.metrics.neofs_obj_get_duration.values.avg || '0'); + const c5 = ~~(data.metrics.neofs_obj_get_duration && data.metrics.neofs_obj_get_duration.values["p(95)"] || '0'); + const c6 = ~~(data.metrics.neofs_obj_put_total && data.metrics.neofs_obj_put_total.values.rate || '0'); + const c7 = ~~(data.metrics.neofs_obj_put_duration && data.metrics.neofs_obj_put_duration.values.avg || '0'); + const c8 = ~~(data.metrics.neofs_obj_put_duration && data.metrics.neofs_obj_put_duration.values["p(95)"] || '0'); + const c9 = ~~(data.metrics.neofs_obj_delete_total && data.metrics.neofs_obj_delete_total.values.rate || '0'); + const c10 = ~~(data.metrics.neofs_obj_delete_duration && data.metrics.neofs_obj_delete_duration.values.avg || '0'); + const c11 = ~~(data.metrics.neofs_obj_delete_duration && data.metrics.neofs_obj_delete_duration.values["p(95)"] || '0'); + + if (result_format == 'terse') { + return { + stdout: `${neo_ver};${test_type};${run_id};${test_id};${size_id};${vu_qty};${host_id};${run_id}_${test_id}_${size_id}k_${vu_qty}vu_${neo_ver};${c1};${c2};${c3};${c4};${c5};${c6};${c7};${c8};${c9};${c10};${c11}\n` + }; + } +}