Skip to content

Commit

Permalink
Merge pull request #93 from nspcc-dev/feat/terce-output
Browse files Browse the repository at this point in the history
Feat/terce output
  • Loading branch information
roman-khimov authored Oct 31, 2024
2 parents d026397 + f6631a0 commit 3ee723b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions scenarios/grpc.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,34 @@ 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 e3 = (data.metrics.neofs_obj_get_fails && data.metrics.neofs_obj_get_fails.values.rate || '0');
const c3 = ~~((data.metrics.neofs_obj_get_total && data.metrics.neofs_obj_get_total.values.rate || '0') - e3);
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 e6 = (data.metrics.neofs_obj_put_fails && data.metrics.neofs_obj_put_fails.values.rate || '0');
const c6 = ~~((data.metrics.neofs_obj_put_total && data.metrics.neofs_obj_put_total.values.rate || '0') - e6);
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 e9 = (data.metrics.neofs_obj_delete_fails && data.metrics.neofs_obj_delete_fails.values.rate || '0');
const c9 = ~~((data.metrics.neofs_obj_delete_total && data.metrics.neofs_obj_delete_total.values.rate || '0') - e9);
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`
};
}
}
3 changes: 2 additions & 1 deletion scenarios/preset/preset_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from argparse import Namespace
from concurrent.futures import ProcessPoolExecutor
from os.path import expanduser

from helpers.cmd import random_payload
from helpers.neofs_cli import create_container, upload_object
Expand Down Expand Up @@ -33,7 +34,7 @@
def main():
container_list = []
objects_struct = []
payload_filepath = '/tmp/data_file'
payload_filepath = expanduser("~") + '/data_file_' + args.size + 'k'

endpoints = args.endpoint.split(',')

Expand Down

0 comments on commit 3ee723b

Please sign in to comment.