Skip to content

Commit

Permalink
Merge pull request #8 from redhat-performance/update_for_meta
Browse files Browse the repository at this point in the history
Update the test to use save_results and provide meta_data
  • Loading branch information
dvalinrh authored Sep 18, 2024
2 parents df1206f + 7d217e4 commit 0847fbe
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
26 changes: 16 additions & 10 deletions io_burst/burst_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,26 +315,30 @@ main(int argc, char **argv)
printf("Need to designate at least one disk\n");
exit(1);
}
printf("Offset %ld\n", test_args.offset);
printf("Random operations: %d\n", test_args.random);
printf("# Test meta data start\n");
printf("# Offset %ld\n", test_args.offset);
printf("# Random operations: %d\n", test_args.random);
if ( strcmp(opt_type, "read") == 0 )
test_args.oper_type = READ;
if ( strcmp(opt_type, "write") == 0 )
test_args.oper_type = WRITE;
if ( strcmp(opt_type, "rw") == 0 )
test_args.oper_type = RW;
tptr = threads;
printf("IO requested: %s\n", opt_type);
printf("IO size: %s\n", opt_size);
printf("Run time: %d\n", test_args.run_time);
printf("Sleep time: %d\n", test_args.sleep_time);
printf("Active time: %d\n", test_args.active_time);
printf("# IO requested: %s\n", opt_type);
printf("# IO size: %s\n", opt_size);
printf("# Run time: %d\n", test_args.run_time);
printf("# Sleep time: %d\n", test_args.sleep_time);
printf("# Active time: %d\n", test_args.active_time);
printf("# Test meta data end\n");

for (;;) {
printf("# Test meta data start\n");
tptr1 = strchr(tptr, ',');
test_args.threads = atoi(tptr);
total_threads = test_args.threads;
ptr=test_args.disks;

if (disk_count == 0) {
for (;;) {
ptr1 = strchr(ptr, ',');
Expand All @@ -347,15 +351,15 @@ main(int argc, char **argv)
fgets(buffer, 1024, fd);
fclose(fd);
disk_to_use[disk_count++].disk_size = atoll(buffer);
printf("%s %ld\n", disk_to_use[disk_count - 1].disk_name, disk_to_use[disk_count - 1].disk_size);
printf("# %s %ld\n", disk_to_use[disk_count - 1].disk_name, disk_to_use[disk_count - 1].disk_size);
if (!ptr1)
break;
ptr = ptr1 + 1;
}
}
grand_total_threads = total_threads * disk_count;

printf("total threads: %d\n", grand_total_threads);
printf("# total threads: %d\n", grand_total_threads);
test_args.io_size = convert_size(opt_size);
pthread_barrier_init (&barrier, NULL, grand_total_threads);

Expand Down Expand Up @@ -385,7 +389,9 @@ main(int argc, char **argv)
for (count = 0; count < grand_total_threads; count++) {
pthread_join(run_info[count].tids, NULL);
}
printf("time period: %d\n", run_info[count1].run_time);
printf("#time period: %d\n", run_info[count1].run_time);
printf("# Test meta data end\n");

printf("Disks");
for (count1 = 0; count1 < grand_total_threads; count1++) {
printf(":%s", run_info[count1].disks);
Expand Down
23 changes: 21 additions & 2 deletions io_burst/burst_io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
test_name_run="burst_io"
results_file=""
disk_options=""
burst_io_version="1.0"

arguments="$@"

Expand Down Expand Up @@ -353,9 +354,27 @@ do
done

cd /tmp
mv $run_dir/burst_io_results/$results_file $results_file
$TOOLS_BIN/test_header_info --front_matter --results_file $results_file --host $to_configuration --sys_type $to_sys_type --tuned $to_tuned_setting --results_version $burst_io_version --test_name $test_name_run
cat $run_dir/burst_io_results/$results_file >> $results_file
results=`grep 0: $results_file`
test_results="Ran"
if [ $? -ne 0 ]; then
test_reults="Failed"
else
re='^[0-9]+$'
for i in $results; do
value=`echo $i | cut -d':' -f 2`
if ! [[ $val =~ $re ]] ; then
test_reults="Failed"
break
fi
done
fi
echo $results >> test_results_report
tar cf /tmp/${results_file}.tar $results_file
if [[ -d "/var/lib/pbench-agent" ]]; then

${curdir}/test_tools/save_results --curdir $curdir --home_root $to_home_root --test_name $test_name --tuned_setting $to_tuned_setting --version $burst_io_version --user $to_user --results $results_file --other_files test_results_report
if [[ -d "/var/lib/pbench-agent" ]]; then
copy_to=`echo ${results_file} | sed "s/results_burst/results_pbench_burst/g"`
cp -R /tmp/${results_file}.tar ${copy_to}.tar
change_to=`ls -drt /var/lib/pbench-agent/* | grep pbench-user-benchmark | grep io_burst | grep -v tar | grep -v copied | tail -1`
Expand Down

0 comments on commit 0847fbe

Please sign in to comment.