@@ -24,7 +24,7 @@ nc_port=33101
2424nc_req_msg=$( head -c $nc_req_msg_len /dev/zero | tr ' \0' ' x' )
2525nc_percentiles=(0 1 5 25 50 75 95 99 100)
2626
27- pod_command=" [\" nc\" , \" -lk\" , \" -p\" , \" ${nc_port} \" , \" -e\" , \" /bin/ cat\" ]"
27+ pod_command=" [\" nc\" , \" -lk\" , \" -p\" , \" ${nc_port} \" , \" -e\" , \" sh \" , \" -c \" , \" echo \$ {EPOCHREALTIME/./}; cat; echo \$ {EPOCHREALTIME/./} \" ]"
2828
2929# Set some default metrics env vars
3030TEST_ARGS=" runtime=${RUNTIME} "
@@ -340,7 +340,7 @@ run() {
340340
341341 if [[ ${nc_reqs_per_pod} -ge 1 ]]; then
342342 mkdir -p " $RESULT_DIR " 2> /dev/null || true
343- local latency_raw_output=" $RESULT_DIR /${TEST_NAME// / -} .t_pods_round_ip_latency_fail_rx .raw"
343+ local latency_raw_output=" $RESULT_DIR /${TEST_NAME// / -} .tmaster_tworker_pods_r_ipord_ipaddr_lattot_latconn_latio_latdisconn_rx .raw"
344344 pod_ips=$( kubectl get pods --selector ${LABEL} =${LABELVALUE} -o json | jq -r ' .items[].status.podIP' )
345345 if [[ ${reqs} != $( echo $pod_ips | wc -w) ]]; then
346346 info " WARNING: pod IP count mismatch expected ${reqs} found $( echo $pod_ips | wc -w) "
@@ -349,18 +349,30 @@ run() {
349349 local latency_failures=0
350350 local latency_pod_array=()
351351 for latency_round in $( seq ${nc_reqs_per_pod} ) ; do
352+ local pod_ip_ord=0
352353 for pod_ip in ${pod_ips} ; do
354+ pod_ip_ord=$(( pod_ip_ord + 1 ))
353355 local latency_failed=0
354- local latency_pod_start_time=$( date +%s%N)
355- local latency_pod_response=$( echo ${nc_req_msg} | nc ${pod_ip} ${nc_port} )
356- local latency_pod_end_time=$( date +%s%N)
357- local latency_response_microseconds=$(( (latency_pod_end_time - latency_pod_start_time) / 1000 ))
356+ local latency_pod_start_time=${EPOCHREALTIME/ ./ }
357+ local latency_pod_start_response_end=$( echo ${latency_pod_start_time} ${nc_req_msg} | nc ${pod_ip} ${nc_port} )
358+ # start_response_end contents: <worker_start_ts> <master_ts> <nc_req_msg> <worker_end_ts>
359+ local latency_pod_end_time=${EPOCHREALTIME/ ./ }
360+ local latency_response_microseconds=$(( latency_pod_end_time - latency_pod_start_time ))
361+ local latency_pod_response=$( echo $latency_pod_start_response_end | awk ' {print $3}' )
358362 if [[ " $latency_pod_response " != " ${nc_req_msg} " ]]; then
359363 latency_failures=$(( latency_failures + 1 ))
364+ local latency_pod_first_t=000000000000000
365+ local latency_pod_last_t=000000000000000
360366 latency_failed=1
367+ else
368+ local latency_pod_first_t=$( echo $latency_pod_start_response_end | awk ' {print $1}' )
369+ local latency_pod_last_t=$( echo $latency_pod_start_response_end | awk ' {print $4}' )
361370 fi
371+ local latency_pod_local_io=$(( latency_pod_last_t - latency_pod_first_t ))
372+ local latency_pod_conn=$(( latency_pod_first_t - latency_pod_start_time ))
373+ local latency_pod_disconn=$(( latency_pod_end_time - latency_pod_last_t ))
362374 latency_pod_array+=($latency_response_microseconds )
363- echo " $latency_pod_start_time $reqs $latency_round $pod_ip $latency_response_microseconds $latency_failed $ ( echo $latency_pod_response | wc -c) " >> $latency_raw_output
375+ echo " $latency_pod_start_time $latency_pod_first_t $ reqs $latency_round $pod_ip_ord $ pod_ip $latency_response_microseconds $latency_pod_conn $latency_pod_local_io $latency_pod_disconn $ ( echo $latency_pod_start_response_end | wc -c) " >> $latency_raw_output
364376 done
365377 done
366378 IFS=$' \n '
0 commit comments