-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It's 99th percentile. It means that 99% of the requests should be faster than given latency. Longhorn 8254 Signed-off-by: Derek Su <[email protected]>
- Loading branch information
Showing
3 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
CURRENT_DIR="$(dirname "$(readlink -f "$0")")" | ||
source $CURRENT_DIR/func.sh | ||
|
||
append_metric() { | ||
local metric_name="${1}" | ||
local metric_unit="${2}" | ||
local randread="${3}" | ||
local cpu_idle_pct_randread="${4}" | ||
local randwrite="${5}" | ||
local cpu_idle_pct_randwrite="${6}" | ||
local seqread="${7}" | ||
local cpu_idle_pct_seqread="${8}" | ||
local seqwrite="${9}" | ||
local cpu_idle_pct_seqwrite="${10}" | ||
|
||
if [ "$CPU_IDLE_PROF" = "enabled" ]; then | ||
# If CPU idle profiling is enabled, include it in the output | ||
printf -v cxt "%s in %s with CPU idleness in percent (Read/Write)\n$FMT$FMT\n" \ | ||
"$metric_name" "$metric_unit" \ | ||
"Random:" \ | ||
"$(commaize "${randread:-0}") ($(commaize "${cpu_idle_pct_randread:-0}")) / $(commaize "${randwrite:-0}") ($(commaize "${cpu_idle_pct_randwrite:-0}"))" \ | ||
"Sequential:" \ | ||
"$(commaize "${seqread:-0}") ($(commaize "${cpu_idle_pct_seqread:-0}")) / $(commaize "${seqwrite:-0}") ($(commaize "${cpu_idle_pct_seqwrite:-0}"))" | ||
else | ||
# If CPU idle profiling is not enabled, exclude it from the output | ||
printf -v cxt "%s in %s (Read/Write)\n$FMT$FMT\n" \ | ||
"$metric_name" "$metric_unit" \ | ||
"Random:" \ | ||
"$(commaize "${randread:-0}") / $(commaize "${randwrite:-0}")" \ | ||
"Sequential:" \ | ||
"$(commaize "${seqread:-0}") / $(commaize "${seqwrite:-0}")" | ||
fi | ||
SUMMARY+="$cxt" | ||
} | ||
|
||
|
||
if [ -z "${1}" ]; then | ||
echo Require FIO IO types | ||
exit 1 | ||
fi | ||
IO_TYPES="${1}" | ||
|
||
if [ -z "${2}" ]; then | ||
echo Require FIO metrics | ||
exit 1 | ||
fi | ||
METRICS="${2}" | ||
|
||
if [ -z "${3}" ]; then | ||
echo Require FIO output prefix | ||
exit 1 | ||
fi | ||
PREFIX="${3}" | ||
|
||
|
||
IFS=',' read -r -a io_types_array <<< "${IO_TYPES}" | ||
IFS=',' read -r -a metrics_array <<< "${METRICS}" | ||
|
||
for TYPE in "${io_types_array[@]}"; do | ||
for METRIC in "${metrics_array[@]}"; do | ||
OUTPUT="${PREFIX}-${TYPE}-${METRIC}.json" | ||
parse_${TYPE}_${METRIC}_p99 "$OUTPUT" | ||
done | ||
done | ||
|
||
|
||
# Initialize the result file name | ||
RESULT=${PREFIX}.p99_summary | ||
|
||
# Build the summary with header information | ||
SUMMARY=" | ||
========================= | ||
FIO Benchmark Latency P99 Summary | ||
For: $PREFIX | ||
CPU Idleness Profiling: ${CPU_IDLE_PROF:-not provided} | ||
Size: ${SIZE:-10g} | ||
Quick Mode: ${QUICK_MODE:-disabled} | ||
========================= | ||
" | ||
|
||
append_metric "Latency" "ns" \ | ||
"$RANDREAD_LATENCY_P99" "$CPU_IDLE_PCT_RANDREAD_LATENCY" \ | ||
"$RANDWRITE_LATENCY_P99" "$CPU_IDLE_PCT_RANDWRITE_LATENCY" \ | ||
"$SEQREAD_LATENCY_P99" "$CPU_IDLE_PCT_SEQREAD_LATENCY" \ | ||
"$SEQWRITE_LATENCY_P99" "$CPU_IDLE_PCT_SEQWRITE_LATENCY" | ||
|
||
echo "$SUMMARY" > "$RESULT" | ||
cat "$RESULT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters