-
Notifications
You must be signed in to change notification settings - Fork 0
Pts #42
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
Closed
Closed
Pts #42
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
7e81ab3
phoronix suite commits
sousinha97 0346e50
test index
sousinha97 05fbe65
Add files via upload
sousinha97 02a40e4
PTS
sousinha1997 eea2eb3
resolve
sousinha1997 b0bc1f8
resolve
sousinha1997 b5cfc2d
Update run_phoronix.sh
sousinha97 1834d19
cockroach retrive result added
sousinha1997 c65e25f
Merge remote-tracking branch 'origin/PTS' into PTS
sousinha1997 ee40aa0
usage update
sousinha1997 a0626ff
redis push
sousinha1997 67890dd
review push _ stress-ng addition
sousinha1997 f51bf4f
refactor
sousinha1997 4d65241
Update run_phoronix.sh
sousinha97 fe77145
refactor
sousinha1997 2108e31
Merge remote-tracking branch 'origin/PTS' into PTS
sousinha1997 a4c1bee
stress ng fix
sousinha1997 71080a0
iotdb, phpbench
sousinha1997 afff79e
nginx add
sousinha1997 70a752f
sqlite add
sousinha1997 ee3ee66
openssl add
sousinha1997 e81032f
new changes override
sousinha1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,288 @@ | ||
#!/bin/bash | ||
egrep 'Test: |Average' results_phoronix_tuned_*.out | grep -v stress > tmpfile | ||
echo "Test:BOPs" | ||
toggle=0 | ||
while IFS= read -r line | ||
do | ||
if [ $toggle -eq 0 ]; then | ||
out=`echo $line | cut -d':' -f2 | sed "s/^ //g" | sed "s/\[1\;34m//g"` | ||
printf "%s:" "$out" | ||
toggle=1 | ||
else | ||
out=`echo $line | cut -d':' -f 2 | cut -d' ' -f 2 | sed "s/\[1\;34m//g"` | ||
printf "%s\n" $out | ||
toggle=0 | ||
fi | ||
done < "tmpfile" | ||
rm tmpfile | ||
|
||
usage() { | ||
echo "Usage:" | ||
echo " ./reduce_phoronix --sub_test <test_ran> --tmp_name <output_temp_file>" | ||
echo "Options:" | ||
echo " -h Show help" | ||
echo " --sub_test Specify the test data to reduce" | ||
echo " --tmp_file Specify output temp file" | ||
exit 1 | ||
} | ||
|
||
# Initialize variables | ||
test_ran="none" | ||
tmp_file="none" | ||
|
||
reduce_cockroach() { | ||
echo "Workload:Concurrency:Average:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
# Check for lines containing workload and concurrency | ||
if [[ $line == *Workload* ]]; then | ||
# Extract Workload and Concurrency | ||
workload=$(echo "$line" | awk -F ': ' '{print $2}' | awk -F ' - ' '{print $1}') | ||
concurrency=$(echo "$line" | awk -F ': ' '{print $3}' | tr -d ':') | ||
fi | ||
if [[ $line == *Average* ]]; then | ||
# Extract Average | ||
average=$(echo "$line" | awk -F ': ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *Deviation* ]]; then | ||
# Extract Deviation | ||
deviation=$(echo "$line" | awk -F ': ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$workload:$concurrency:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_phpbench() { | ||
echo "Average:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average value | ||
average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation value | ||
deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_redis() { | ||
echo "Test:ParallelConnections:Average:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
# Check for lines containing Test and Parallel Connections | ||
if [[ $line == *"Test:"* && $line == *"Parallel Connections:"* ]]; then | ||
# Extract Test and Parallel Connections | ||
test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ' - ' '{print $1}') | ||
parallel_connections=$(echo "$line" | awk -F ': ' '{print $3}' | tr -d ':') | ||
fi | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average | ||
average=$(echo "$line" | awk -F ': ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation | ||
deviation=$(echo "$line" | awk -F ': ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$test:$parallel_connections:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_cassandra() { | ||
echo "Test:Average:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
# Check for lines containing Test | ||
if [[ $line == *"Test:"* ]]; then | ||
# Extract Test name (after "Test: " and before the colon) | ||
test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ':' '{print $1}') | ||
fi | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average value | ||
average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation value | ||
deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$test:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_apache-iotdb() { | ||
# Header for CSV file | ||
echo "device_count:batch_size:sensor_count:client_number:point_sec:latency" > "$tmp_file" | ||
|
||
# Initialize variables to store values for each test configuration | ||
device_count="" | ||
batch_size="" | ||
sensor_count="" | ||
client_number="" | ||
point_sec="" | ||
latency="" | ||
# Iterate through the test output file (replace this with the actual test output file) | ||
while IFS= read -r line; do | ||
# Extract the configuration line (e.g., Device Count: 100 - Batch Size Per Write: 1 - Sensor Count: 200 - Client Number: 100) | ||
if [[ "$line" =~ \[\Device\ Count:\ ([0-9]+).*Batch\ Size\ Per\ Write:\ ([0-9]+).*Sensor\ Count:\ ([0-9]+).*Client\ Number:\ ([0-9]+)] ]]; then | ||
# Save the configuration | ||
device_count="${BASH_REMATCH[1]}" | ||
batch_size="${BASH_REMATCH[2]}" | ||
sensor_count="${BASH_REMATCH[3]}" | ||
client_number="${BASH_REMATCH[4]}" | ||
fi | ||
# Extract points/sec (e.g., Average: 139645 point/sec) | ||
if [[ "$line" =~ Average:\ ([0-9]+)\ point/sec ]]; then | ||
point_sec="${BASH_REMATCH[1]}" | ||
fi | ||
# Extract latency (e.g., Average Latency: 117.59) | ||
if [[ "$line" =~ Average\ Latency:\ ([0-9]+\.[0-9]+) ]]; then | ||
latency="${BASH_REMATCH[1]}" | ||
fi | ||
# After reading the point_sec and latency for a test configuration, append it to the output CSV | ||
if [[ -n "$device_count" && -n "$batch_size" && -n "$sensor_count" && -n "$client_number" ]]; then | ||
echo "$device_count:$batch_size:$sensor_count:$client_number:${point_sec:-}:$latency" >> "$tmp_file" | ||
device_count="" | ||
batch_size="" | ||
sensor_count="" | ||
client_number="" | ||
point_sec="" | ||
latency="" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_nginx(){ | ||
echo "Connections:RPS" > "$tmp_file" | ||
while IFS= read -r line; do | ||
# Check for lines containing Connections | ||
if [[ $line == *"Connections:"* ]]; then | ||
# Extract Test name (after "Connections: " and before the colon) | ||
connection=$(echo "$line" | awk -F 'Connections: ' '{print $2}' | awk -F ':' '{print $1}') | ||
fi | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average value | ||
average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation value | ||
deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$connection:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_stress_ng() { | ||
echo "Test:Average:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
# Check for lines containing Test | ||
if [[ $line == *"Test:"* ]]; then | ||
# Extract Test name (after "Test: " and before the colon) | ||
test=$(echo "$line" | awk -F 'Test: ' '{print $2}' | awk -F ':' '{print $1}') | ||
fi | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average value | ||
average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation value | ||
deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$test:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_sqlite() { | ||
echo "Threads:Average:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
# Check for lines containing Threads | ||
if [[ $line == *"Threads / Copies:"* ]]; then | ||
# Extract Test name (after "Test: " and before the colon) | ||
test=$(echo "$line" | awk -F 'Threads / Copies: ' '{print $2}' | awk -F ':' '{print $1}') | ||
fi | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average value | ||
average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation value | ||
deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$threads:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
reduce_openssl() { | ||
echo "Algorithm:BPS:Deviation" > "$tmp_file" | ||
# Read and process the results file | ||
while IFS= read -r line; do | ||
# Check for lines containing Threads | ||
if [[ $line == *"Algorithm:"* ]]; then | ||
# Extract Algorithm name (after "Algorithm: " and before the colon) | ||
algorithm=$(echo "$line" | awk -F 'Algorithm: ' '{print $2}' | awk -F ':' '{print $1}') | ||
fi | ||
if [[ $line == *"Average:"* ]]; then | ||
# Extract Average value | ||
average=$(echo "$line" | awk -F 'Average: ' '{print $2}' | awk '{print $1}') | ||
fi | ||
if [[ $line == *"Deviation:"* ]]; then | ||
# Extract Deviation value | ||
deviation=$(echo "$line" | awk -F 'Deviation: ' '{print $2}' | tr -d '%') | ||
# Append the extracted information to the output file | ||
echo "$algorithm:$average:$deviation" >> "$tmp_file" | ||
fi | ||
done < /tmp/results_phoronix_"$test_ran"_tuned_*.out | ||
} | ||
|
||
# Check if an argument is passed | ||
if [ $# -eq 0 ]; then | ||
usage | ||
fi | ||
|
||
|
||
# Process command line arguments | ||
while [ $# -gt 0 ]; do | ||
case $1 in | ||
-h) | ||
usage | ||
;; | ||
--sub_test) | ||
test_ran=$2 | ||
shift 2 | ||
;; | ||
--tmp_file) | ||
tmp_file=$2 | ||
shift 2 | ||
;; | ||
*) | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
# Check if a test data to reduce is designated | ||
if [ "$test_ran" == "none" ]; then | ||
echo "You need to designate a test to reduce." | ||
usage | ||
fi | ||
if [ "$tmp_file" == "none" ]; then | ||
echo "You need a file to output to" | ||
usage | ||
fi | ||
|
||
if [[ ${test_ran} == "cockroach" ]]; then | ||
reduce_cockroach | ||
elif [[ ${test_ran} == "redis" ]]; then | ||
reduce_redis | ||
elif [[ ${test_ran} == "stress-ng" ]]; then | ||
reduce_stress_ng | ||
elif [[ ${test_ran} == "phpbench" ]]; then | ||
reduce_phpbench | ||
elif [[ ${test_ran} == "cassandra" ]]; then | ||
reduce_cassandra | ||
elif [[ ${test_ran} == "apache-iotdb" ]]; then | ||
reduce_apache-iotdb | ||
elif [[ ${test_ran} == "nginx" ]]; then | ||
reduce_nginx | ||
elif [[ ${test_ran} == "sqlite" ]]; then | ||
reduce_sqlite | ||
elif [[ ${test_ran} == "openssl" ]]; then | ||
reduce_openssl | ||
else | ||
echo "Unsupported test: ${test_ran}" | ||
exit 1 | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.