添加node测试

main
yanenshuo 3 months ago
parent 364f474cb7
commit 8db8516501

@ -2,16 +2,18 @@ include Makefile.inc
#TESTS=fibonacci fibonacci2 fibonacci3 big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty
TESTS=fibonacci big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty
TESTS2=noop
TESTSRT=$(TESTS:%=%_rt)
TESTSRT2=$(TESTS2:%=%_rt)
.PHONY: all clean rttests tinyekf cifar10 gocr sod
.PHONY: all clean rttests tinyekf cifar10 gocr sod add
all: rttests tinyekf cifar10 gocr sod
@echo "Test Compilation done!"
rttests: $(TESTSRT)
add: $(TESTSRT2)
clean:
@echo "Cleaning Test Applications"

@ -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)

@ -16,17 +16,20 @@ server_log="noop_"$chain_len".log"
log="noop"$chain_len"-"$repeat_t".txt"
start_script="start-noop"$chain_len".sh"
echo $start_script
path="/users/xiaosuGW/sledge-serverless-framework/runtime/tests"
chmod 400 $path/id_rsa
path="/home/weihao/sledge/sledge_tree/runtime/tests"
ssh -o stricthostkeychecking=no -i $path/id_rsa xiaosuGW@10.10.1.1 "$path/$start_script $server_log >/dev/null 2>&1 &"
hey -c 1 -z 60s -disable-keepalive -m GET -d 29 "http://10.10.1.1:10000" > $log 2>&1 &
$path/$start_script $server_log >/dev/null 2>&1 &
echo "hey test"
hey -c 1 -z 60s -disable-keepalive -m GET "http://127.0.0.1:10000" > $log 2>&1 &
pid1=$!
wait -f $pid1
printf "[OK]\n"
ssh -o stricthostkeychecking=no -i $path/id_rsa xiaosuGW@10.10.1.1 "$path/kill_sledge.sh"
$path/kill_sledge.sh

@ -0,0 +1,8 @@
## 本地回环 E2E时间测试 三轮测试平均
| 函数个数 | noop1 | noop3 | noop5 |
| ------------------------------ | ------------- | ------------- | ------------- |
| 三轮测试数据?E2E时间ms | 0.4、0.4、0.4 | 0.5、0.5、05. | 0.7、0.7、0.7 |
| 平均E2E时间(ms) | 0.4 | 0.5 | 0.7 |
| 三轮测试数据?初始化时间us | 9 | 115 | 220 |
| 平均初始化时间us | 8.9、8.8、9.1 | 115、115、114 | 223、217、221 |

@ -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

@ -73,7 +73,7 @@
"\n",
"colors=list(mcolors.TABLEAU_COLORS.keys()) \n",
"\n",
"with open('G:\\\\test_data\\\\rate.txt', 'r') as f:\n",
"with open('G:\\\\test_data\\\\'rate.txt, 'r') as f:\n",
" min_seg = 512\n",
" for line in f.readlines():\n",
" line = line.strip()\n",
@ -2703,7 +2703,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
"version": "3.12.3"
}
},
"nbformat": 4,

@ -14,16 +14,19 @@ output=$1
declare project_path="$(
cd "$(dirname "$0")/../../.."
cd "$(dirname "$0")/../.."
pwd
)"
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
export SLEDGE_CPU_SPEED=2400
export SLEDGE_SCHEDULER=EDF
export SLEDGE_SIGALRM_HANDLER=BROADCAST
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/compare/test_work1k.json
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop1.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_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

@ -20,11 +20,11 @@ declare project_path="$(
echo $project_path
path=`pwd`
#export SLEDGE_DISABLE_PREEMPTION=true
export SLEDGE_CPU_SPEED=2400
export SLEDGE_SCHEDULER=SRSF
export SLEDGE_CPU_SPEED=2500
export SLEDGE_SCHEDULER=EDF
export SLEDGE_SIGALRM_HANDLER=BROADCAST
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
#export SLEDGE_NWORKERS=1
export SLEDGE_NWORKERS=32
#export SLEDGE_SCHEDULER=EDF
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
echo $SLEDGE_SANDBOX_PERF_LOG

@ -182,3 +182,187 @@
"tail-module": true
},
{
"active": true,
"name": "resize5",
"path": "resize_wasm.so",
"port": 10012,
"relative-deadline-us": 392870,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp5",
"path": "C-Image-Manip_wasm.so",
"port": 10013,
"relative-deadline-us": 392870,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_5",
"path": "cifar10_wasm.so",
"port": 10014,
"relative-deadline-us": 392870,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize6",
"path": "resize_wasm.so",
"port": 10015,
"relative-deadline-us": 963810,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp6",
"path": "C-Image-Manip_wasm.so",
"port": 10016,
"relative-deadline-us": 963810,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_6",
"path": "cifar10_wasm.so",
"port": 10017,
"relative-deadline-us": 963810,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize7",
"path": "resize_wasm.so",
"port": 10018,
"relative-deadline-us": 81730,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp7",
"path": "C-Image-Manip_wasm.so",
"port": 10019,
"relative-deadline-us": 81730,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_7",
"path": "cifar10_wasm.so",
"port": 10020,
"relative-deadline-us": 81730,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},
{
"active": true,
"name": "resize8",
"path": "resize_wasm.so",
"port": 10021,
"relative-deadline-us": 239120,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/jpeg",
"http-req-size": 1024000,
"http-resp-headers": [],
"http-resp-size": 1024000,
"http-resp-content-type": "image/png"
},
{
"active": true,
"name": "png2bmp8",
"path": "C-Image-Manip_wasm.so",
"port": 10022,
"relative-deadline-us": 239120,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/png",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 4096000,
"http-resp-content-type": "image/bmp"
},
{
"active": true,
"name": "cifar10_8",
"path": "cifar10_wasm.so",
"port": 10023,
"relative-deadline-us": 239120,
"argsize": 1,
"http-req-headers": [],
"http-req-content-type": "image/bmp",
"http-req-size": 4096000,
"http-resp-headers": [],
"http-resp-size": 1024,
"http-resp-content-type": "text/plain",
"tail-module": true
},

@ -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…
Cancel
Save