Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/terce output #93

Merged
merged 3 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');
Comment on lines +176 to +189
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these names mean something special?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, these names are chosen for convenience, they can be changed to something more meaningful.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if I change the names, the output line will be too long.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output line is already too long, but I do not insist


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
Loading