-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-logs-benchmarks.sh
executable file
·134 lines (120 loc) · 5.05 KB
/
run-logs-benchmarks.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/usr/bin/env bash
set -e
echo "Building all targets ..."
build_dir_opentelemetry_off=/tmp/build_dir_opentelemetry_off
mkdir -p "$build_dir_opentelemetry_off"
cmake -B "$build_dir_opentelemetry_off" -S . \
-D CMAKE_BUILD_TYPE=Release \
-D TRACING_ENABLED=ON \
-D OPENTELEMETRY_C_TRACING_ENABLED=OFF
cmake --build "$build_dir_opentelemetry_off" --target all --
build_dir_lttng_exporter_on=/tmp/build_dir_lttng_exporter_on
mkdir -p "$build_dir_lttng_exporter_on"
cmake -B "$build_dir_lttng_exporter_on" -S . \
-D CMAKE_BUILD_TYPE=Release \
-D TRACING_ENABLED=ON \
-D OPENTELEMETRY_C_TRACING_ENABLED=ON \
-D LTTNG_EXPORTER_ENABLED=ON
cmake --build "$build_dir_lttng_exporter_on" --target all --
build_dir_lttng_exporter_off=/tmp/build_dir_lttng_exporter_off
mkdir -p "$build_dir_lttng_exporter_off"
cmake -B "$build_dir_lttng_exporter_off" -S . \
-D CMAKE_BUILD_TYPE=Release \
-D TRACING_ENABLED=ON \
-D OPENTELEMETRY_C_TRACING_ENABLED=ON \
-D LTTNG_EXPORTER_ENABLED=OFF
cmake --build "$build_dir_lttng_exporter_off" --target all --
n=10 # n = number of run per executable
all_executables=(
"benchmark-logs-simple"
)
for executable in "${all_executables[@]}"; do
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=OFF without lttng session ##########"
time "$build_dir_opentelemetry_off/$executable"
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=OFF in lttng session but all events disabled ##########"
lttng create
lttng enable-channel --userspace default-channel
lttng start
time "$build_dir_opentelemetry_off/$executable"
lttng stop
lttng destroy
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=OFF in lttng session ust event enabled ##########"
lttng create
lttng enable-event -u 'opentelemetry:*'
lttng start
time "$build_dir_opentelemetry_off/$executable"
lttng stop
lttng destroy
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=OFF in remote lttng session ust event enabled ##########"
if ping -c 5 "132.207.72.28"; then
lttng create --set-url=net://132.207.72.28
lttng enable-event -u 'opentelemetry:*'
lttng start
time "$build_dir_opentelemetry_off/$executable"
lttng stop
lttng destroy
else
echo "Remote lttng not responding"
fi
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=ON LTTNG_EXPORTER_ENABLED=OFF with local collector ##########"
if curl "http://localhost:13133/" | grep -q "Server available"; then
time OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="http://localhost:4317/" "$build_dir_lttng_exporter_off/$executable"
else
echo "Local collector not responding"
fi
done
# Run benchmark with remote collector only if available
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=ON LTTNG_EXPORTER_ENABLED=OFF with remote collector ##########"
if curl "http://132.207.72.28:13133/" | grep -q "Server available"; then
time OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="http://132.207.72.28:4317" "$build_dir_lttng_exporter_off/$executable"
else
echo "Remote collector not responding"
fi
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=ON LTTNG_EXPORTER_ENABLED=ON without lttng session ##########"
time "$build_dir_lttng_exporter_on/$executable"
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=ON LTTNG_EXPORTER_ENABLED=ON in lttng session but all events disabled ##########"
lttng create
lttng enable-channel --userspace default-channel
lttng start
time "$build_dir_lttng_exporter_on/$executable"
lttng stop
lttng destroy
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=ON LTTNG_EXPORTER_ENABLED=ON in lttng session ust event enabled ##########"
lttng create
lttng enable-event -u 'opentelemetry:*'
lttng start
time "$build_dir_lttng_exporter_on/$executable"
lttng stop
lttng destroy
done
for i in $(seq 1 $n); do
echo "########## Run no $i executable=$executable TRACING_ENABLED=ON OPENTELEMETRY_C_TRACING_ENABLED=ON LTTNG_EXPORTER_ENABLED=ON in remote lttng session ust event enabled ##########"
if ping -c 5 "132.207.72.28"; then
lttng create --set-url=net://132.207.72.28
lttng enable-event -u 'opentelemetry:*'
lttng start
time "$build_dir_lttng_exporter_on/$executable"
lttng stop
lttng destroy
else
echo "Remote lttng not responding"
fi
done
done
echo "Done!"