File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
tekton-resources/tasks/generators/clusterloader Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 4343 start_epoch=$(date +%s%3N)
4444 # fetch credentials
4545 status_code=$(curl -s -o /dev/null -w "%{http_code}" --max-time 2 -H "Authorization: $AUTH_TOKEN" http://169.254.170.23/v1/credentials)
46+ end_epoch=$(date +%s%3N)
4647 if [ "$status_code" -eq 200 ]; then
47- end_epoch=$(date +%s%3N)
4848 printf "Endpoint is reachable at try %d\n" "$i"
4949
5050 latency_ms=$((end_epoch - start_epoch))
Original file line number Diff line number Diff line change @@ -290,7 +290,13 @@ spec:
290290 int_p999=$(echo "$p999" | awk '{printf "%d", $1}')
291291 echo "p99.9 is $p999"
292292
293- if [ "$int_p999" -lt 1 ] && [ "$total_samples" -eq "$expected_pods" ]; then
293+ # Calculate 0.1% tolerance (expected_pods * 0.001)
294+ tolerance=$(echo "$expected_pods" | awk '{printf "%.0f", $1 * 0.001}')
295+ max_allowed=$((expected_pods + tolerance))
296+
297+ echo "Tolerance: $tolerance, max allowed samples: $max_allowed"
298+
299+ if [ "$int_p999" -lt 1 ] && [ "$total_samples" -ge "$expected_pods" ] && [ "$total_samples" -le "$max_allowed" ]; then
294300 echo "1" | tee $(results.datapoint.path)
295301 else
296302 echo "0" | tee $(results.datapoint.path)
You can’t perform that action at this time.
0 commit comments