parent
364f474cb7
commit
8db8516501
@ -0,0 +1,22 @@
|
||||
import os
|
||||
|
||||
def calculate_average(filename):
|
||||
with open(filename, "r") as file:
|
||||
values = file.readlines()
|
||||
values = [int(value.strip()) for value in values]
|
||||
average = sum(values) / len(values) if values else 0
|
||||
return average
|
||||
|
||||
def main():
|
||||
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
|
||||
|
||||
for noop in noop_functions:
|
||||
filename = f"{noop}.txt"
|
||||
if os.path.exists(filename):
|
||||
average = calculate_average(filename)
|
||||
print(f"Average for {filename}: {average}")
|
||||
else:
|
||||
print(f"{filename} does not exist.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -0,0 +1,26 @@
|
||||
import sys
|
||||
|
||||
def process_file(input_file, noop_functions):
|
||||
data = {noop: [] for noop in noop_functions}
|
||||
|
||||
with open(input_file, "r") as infile:
|
||||
for line in infile:
|
||||
for noop in noop_functions:
|
||||
if noop in line:
|
||||
value = line.split(",")[6]
|
||||
data[noop].append(value)
|
||||
|
||||
for noop, values in data.items():
|
||||
with open(f"{noop}.txt", "w") as outfile:
|
||||
outfile.write("\n".join(values))
|
||||
|
||||
if __name__ == "__main__":
|
||||
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
|
||||
|
||||
argv = sys.argv[1:]
|
||||
if len(argv) < 1:
|
||||
print("usage:", sys.argv[0], "file_dir percentage")
|
||||
sys.exit()
|
||||
|
||||
input_file = argv[0]
|
||||
process_file(input_file, noop_functions)
|
@ -1 +0,0 @@
|
||||
a
|
@ -1 +0,0 @@
|
||||
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
@ -1,17 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [cpu-log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
path="/home/hai/sledge-old/runtime/tests"
|
||||
|
||||
#test work1k 2000
|
||||
server_log_file="edf_1k.log"
|
||||
$path/compare/start_compare.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./hey_test_compare.sh 60 22
|
||||
$path/kill_sledge.sh
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -1,25 +0,0 @@
|
||||
function usage {
|
||||
echo "$0 [duration(s)] [concurrency]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 2 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
duration=$1
|
||||
concurrency=$2
|
||||
|
||||
f1="1byte_"$concurrency".txt"
|
||||
echo $f1
|
||||
f2="0.4k_"$concurrency".txt"
|
||||
|
||||
./test_8c.sh $f1 $duration $concurrency 1byte_file 10000 2>&1 &
|
||||
pid1=$!
|
||||
./test_8c.sh $f2 $duration $concurrency 410byte_file 10004 2>&1 &
|
||||
pid4=$!
|
||||
wait -f $pid1
|
||||
wait -f $pid2
|
||||
printf "[OK]\n"
|
||||
|
@ -1,22 +0,0 @@
|
||||
function usage {
|
||||
echo "$0 [output file] [duration(s)] [concurrency] [image file] [port]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 5 ] ; then
|
||||
echo "input parameters are not 5"
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
output=$1
|
||||
duration=$2
|
||||
concurrency=$3
|
||||
image=$4
|
||||
port=$5
|
||||
|
||||
echo "hey -disable-compression -disable-keepalive -disable-redirects -c $concurrency -z $duration\s -t 0 -m GET -D "$image" "http://127.0.0.1:$port" > $output"
|
||||
|
||||
#hey -disable-compression -disable-keepalive -disable-redirects -c 1 -q $rps -z $duration\s -cpus 1 -t 0 -m GET -D "$image" "http://10.10.1.1:$port"
|
||||
#hey -disable-compression -disable-keepalive -disable-redirects -c $concurrency -z 20s -t 0 -m GET -D "$image" "http://10.10.1.1:$port"
|
||||
hey -disable-compression -disable-keepalive -disable-redirects -n 5000 -c $concurrency -z $duration\s -t 0 -m GET -D "$image" "http://127.0.0.1:$port" > $output
|
@ -1,114 +0,0 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k1_1",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k1_2",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10001,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k1_3",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10002,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k1_4",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10003,
|
||||
"relative-deadline-us": 50000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k2_1",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10004,
|
||||
"relative-deadline-us": 90000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k2_2",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10005,
|
||||
"relative-deadline-us": 90000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k2_3",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10006,
|
||||
"relative-deadline-us": 90000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plain"
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "work1k2_4",
|
||||
"path": "work1k_wasm.so",
|
||||
"port": 10007,
|
||||
"relative-deadline-us": 90000,
|
||||
"argsize": 1,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 1200,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 1200,
|
||||
"http-resp-content-type": "text/plaini",
|
||||
"tail-module": true
|
||||
},
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,34 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [cpu-log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
#basepath=$(cd `dirname $0`; pwd)
|
||||
#cpu_log=$1
|
||||
|
||||
#if [ -z $cpu_log ]
|
||||
#then
|
||||
# usage
|
||||
#fi
|
||||
|
||||
|
||||
#node1_cpu_file=$cpu_log"_node1_cpu.log"
|
||||
path="/home/hai/sledge-old/runtime/tests"
|
||||
|
||||
#test c3
|
||||
server_log_file="edf_15.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./hey_test_8c.sh 120 15
|
||||
$path/kill_sledge.sh
|
||||
|
||||
#test c5
|
||||
server_log_file="edf_22.log"
|
||||
$path/start.sh $server_log_file >/dev/null 2>&1 &
|
||||
echo "sledge is running"
|
||||
./hey_test_8c.sh 120 22
|
||||
$path/kill_sledge.sh
|
||||
|
@ -0,0 +1,14 @@
|
||||
#include <stdio.h>
|
||||
|
||||
// 定义一个完全无操作的noop函数
|
||||
void noop() {
|
||||
// 此函数完全不执行任何操作
|
||||
}
|
||||
|
||||
int main() {
|
||||
// 仅调用noop函数
|
||||
noop();
|
||||
|
||||
// main函数也不进行任何输出
|
||||
return 0;
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 1 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
output=$1
|
||||
|
||||
|
||||
declare project_path="$(
|
||||
cd "$(dirname "$0")/../.."
|
||||
pwd
|
||||
)"
|
||||
echo $project_path
|
||||
path=`pwd`
|
||||
#export SLEDGE_DISABLE_PREEMPTION=true
|
||||
export SLEDGE_CPU_SPEED=2500
|
||||
export SLEDGE_SCHEDULER=FIFO
|
||||
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
|
||||
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
|
||||
export SLEDGE_NWORKERS=16
|
||||
#export SLEDGE_SCHEDULER=EDF
|
||||
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
|
||||
echo $SLEDGE_SANDBOX_PERF_LOG
|
||||
cd $project_path/runtime/bin
|
||||
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop3.json
|
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# != 1 ] ; then
|
||||
usage
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
output=$1
|
||||
|
||||
|
||||
declare project_path="$(
|
||||
cd "$(dirname "$0")/../.."
|
||||
pwd
|
||||
)"
|
||||
echo $project_path
|
||||
path=`pwd`
|
||||
#export SLEDGE_DISABLE_PREEMPTION=true
|
||||
export SLEDGE_CPU_SPEED=2500
|
||||
export SLEDGE_SCHEDULER=FIFO
|
||||
#export SLEDGE_SIGALRM_HANDLER=BROADCAST
|
||||
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
|
||||
export SLEDGE_NWORKERS=16
|
||||
#export SLEDGE_SCHEDULER=EDF
|
||||
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
|
||||
echo $SLEDGE_SANDBOX_PERF_LOG
|
||||
cd $project_path/runtime/bin
|
||||
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop5.json
|
@ -0,0 +1,15 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop1",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop1",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop2",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10001,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop3",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10002,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop1",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10000,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop2",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10001,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop3",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10002,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop4",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10003,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
},
|
||||
{
|
||||
"active": true,
|
||||
"name": "noop5",
|
||||
"path": "noop_wasm.so",
|
||||
"port": 10004,
|
||||
"relative-deadline-us": 0,
|
||||
"argsize": 0,
|
||||
"http-req-headers": [],
|
||||
"http-req-content-type": "text/plain",
|
||||
"http-req-size": 0,
|
||||
"http-resp-headers": [],
|
||||
"http-resp-size": 0,
|
||||
"http-resp-content-type": "text/plain",
|
||||
"tail-module": true
|
||||
}
|
Loading…
Reference in new issue