parent
87ba8af8a0
commit
87672b74c4
@ -0,0 +1,30 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
def calculate_average(input_file, column_index):
|
||||||
|
total = 0
|
||||||
|
count = 0
|
||||||
|
|
||||||
|
with open(input_file, 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
columns = line.strip().split(',')
|
||||||
|
if len(columns) > column_index:
|
||||||
|
try:
|
||||||
|
value = float(columns[column_index])
|
||||||
|
total += value
|
||||||
|
count += 1
|
||||||
|
except ValueError:
|
||||||
|
print(f"error value: {columns[column_index]}")
|
||||||
|
|
||||||
|
if count > 0:
|
||||||
|
average = total / count
|
||||||
|
print(f"list {column_index + 1} average: {average}")
|
||||||
|
else:
|
||||||
|
print("no value")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) != 3:
|
||||||
|
print(" python calculate_average.py input_file column_index")
|
||||||
|
else:
|
||||||
|
input_file = sys.argv[1]
|
||||||
|
column_index = int(sys.argv[2]) - 1
|
||||||
|
calculate_average(input_file, column_index)
|
@ -0,0 +1,24 @@
|
|||||||
|
# split_logs.py
|
||||||
|
|
||||||
|
def split_logs(input_file):
|
||||||
|
modules = {
|
||||||
|
"resize1": [],
|
||||||
|
"png2bmp1": [],
|
||||||
|
"lpd_wasm1": [],
|
||||||
|
"cifar10_1": [],
|
||||||
|
"work1": []
|
||||||
|
}
|
||||||
|
|
||||||
|
with open(input_file, 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
for module in modules.keys():
|
||||||
|
if module in line:
|
||||||
|
modules[module].append(line.strip())
|
||||||
|
break
|
||||||
|
|
||||||
|
for module, entries in modules.items():
|
||||||
|
with open(f"{module}.txt", 'w') as outfile:
|
||||||
|
outfile.write("\n".join(entries) + "\n")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
split_logs("sledge.log")
|
@ -0,0 +1,20 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
def split_columns(input_file):
|
||||||
|
columns = []
|
||||||
|
|
||||||
|
with open(input_file, 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
parts = line.strip().split(',')
|
||||||
|
for i, part in enumerate(parts):
|
||||||
|
if len(columns) <= i:
|
||||||
|
columns.append([])
|
||||||
|
columns[i].append(part)
|
||||||
|
|
||||||
|
for i, column in enumerate(columns):
|
||||||
|
with open(f"{input_file[:-4]}_column_{i + 1}.txt", 'w') as outfile:
|
||||||
|
outfile.write("\n".join(column) + "\n")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
for input_file in sys.argv[1:]:
|
||||||
|
split_columns(input_file)
|
@ -1,46 +0,0 @@
|
|||||||
|
|
||||||
Summary:
|
|
||||||
Total: 30.0061 secs
|
|
||||||
Slowest: 0.1721 secs
|
|
||||||
Fastest: 0.0035 secs
|
|
||||||
Average: 0.0088 secs
|
|
||||||
Requests/sec: 227.3541
|
|
||||||
|
|
||||||
Total data: 327456 bytes
|
|
||||||
Size/request: 48 bytes
|
|
||||||
|
|
||||||
Response time histogram:
|
|
||||||
0.004 [1] |
|
|
||||||
0.020 [6695] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
|
|
||||||
0.037 [114] |■
|
|
||||||
0.054 [4] |
|
|
||||||
0.071 [0] |
|
|
||||||
0.088 [5] |
|
|
||||||
0.105 [1] |
|
|
||||||
0.122 [1] |
|
|
||||||
0.138 [0] |
|
|
||||||
0.155 [0] |
|
|
||||||
0.172 [1] |
|
|
||||||
|
|
||||||
|
|
||||||
Latency distribution:
|
|
||||||
10% in 0.0059 secs
|
|
||||||
25% in 0.0068 secs
|
|
||||||
50% in 0.0079 secs
|
|
||||||
75% in 0.0095 secs
|
|
||||||
90% in 0.0119 secs
|
|
||||||
95% in 0.0143 secs
|
|
||||||
99% in 0.0237 secs
|
|
||||||
|
|
||||||
Details (average, fastest, slowest):
|
|
||||||
DNS+dialup: 0.0004 secs, 0.0035 secs, 0.1721 secs
|
|
||||||
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0000 secs
|
|
||||||
req write: 0.0001 secs, 0.0000 secs, 0.0067 secs
|
|
||||||
resp wait: 0.0081 secs, 0.0031 secs, 0.1715 secs
|
|
||||||
resp read: 0.0002 secs, 0.0000 secs, 0.0049 secs
|
|
||||||
|
|
||||||
Status code distribution:
|
|
||||||
[200] 6822 responses
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,50 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function usage {
|
||||||
|
echo "Please enter right parameters: current_rps(*5) add_step(*5) duratime"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# -ne 3 ]; then
|
||||||
|
usage
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "current_rps(*5) add_step(*5) duratime"
|
||||||
|
|
||||||
|
#path="/home/njl/sledge/runtime/tests"
|
||||||
|
path="/home/hai/sledge/sledge/runtime/tests"
|
||||||
|
|
||||||
|
current_rps=$1
|
||||||
|
step=$2
|
||||||
|
duratime=$3
|
||||||
|
max_rps=0
|
||||||
|
max_latency=0
|
||||||
|
|
||||||
|
output="hey_test_max_rps.log"
|
||||||
|
server_log_file="test_rps.log"
|
||||||
|
|
||||||
|
|
||||||
|
loop=1
|
||||||
|
|
||||||
|
for loop in {1..5}; do
|
||||||
|
$path/start-edf.sh $server_log_file >/dev/null 2>&1 &
|
||||||
|
echo "sledge is running loop $loop"
|
||||||
|
|
||||||
|
./test_rps.sh $output $duratime $current_rps 5k.jpg 10000 2>&1 &
|
||||||
|
pid1=$!
|
||||||
|
wait $pid1
|
||||||
|
|
||||||
|
$path/kill_sledge.sh
|
||||||
|
latency=$(grep "Requests" $output | awk -F ': ' '{print $2}')
|
||||||
|
|
||||||
|
if (( $(echo "$latency < $max_rps" | bc -l) )); then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "loop_$loop RPS: $latency"
|
||||||
|
max_rps=$latency
|
||||||
|
current_rps=$((current_rps + step))
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "Maximum RPS: $max_rps"
|
||||||
|
|
Loading…
Reference in new issue