Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4606fd1
add steps to upload metrics summary artifact and display results
deleonenriqueta Dec 18, 2025
5f41b89
added some debugging and an upload summary artifact step
deleonenriqueta Dec 20, 2025
3d3a806
add step to extract test name, update metric upload file step
deleonenriqueta Jan 23, 2026
fb91666
Merge branch 'main' into metric-summary-reporting
deleonenriqueta Jan 23, 2026
59fa0aa
update workflow to publish metrics summary data
deleonenriqueta Feb 12, 2026
fb4ae7b
update naming convention
deleonenriqueta Feb 12, 2026
52885a0
update incorrect name
deleonenriqueta Feb 12, 2026
201d2bf
updating the metrics reporting layout
deleonenriqueta Feb 13, 2026
dc6c473
update format of multitest metric files
deleonenriqueta Feb 13, 2026
4ac8cf0
added wiki formatting for test dropdowns
deleonenriqueta Feb 13, 2026
4ca0b0f
resolve temp file issue
deleonenriqueta Feb 13, 2026
b1bc9f3
update wiki formatting and test name
deleonenriqueta Feb 14, 2026
181f114
continued formatting refinement
deleonenriqueta Feb 18, 2026
3ce7bcd
indented formatting
deleonenriqueta Feb 18, 2026
87e3a8e
adding blockquotes for formatting
deleonenriqueta Feb 19, 2026
9173032
clean up
deleonenriqueta Feb 20, 2026
3330ee3
update block quote
deleonenriqueta Feb 20, 2026
96ba245
update wiki page
deleonenriqueta Feb 21, 2026
b270c47
update results directory
deleonenriqueta Feb 21, 2026
cb80b45
renamed full directory
deleonenriqueta Feb 21, 2026
05e200c
include Framework Version in the metrics reporting table
deleonenriqueta Apr 9, 2026
06346af
organize table with framework version
deleonenriqueta Apr 9, 2026
0940781
cleanup organization and naming
deleonenriqueta Apr 9, 2026
083bf92
update link name
deleonenriqueta Apr 9, 2026
59b901c
cleanup
deleonenriqueta Apr 10, 2026
177bdef
update heap display
deleonenriqueta Apr 10, 2026
bc63f05
extract bash logic for performance metric data formatting
deleonenriqueta Apr 13, 2026
3a8ced3
cleanup
deleonenriqueta Apr 13, 2026
420075d
update layout
deleonenriqueta Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 187 additions & 0 deletions .github/scripts/process-performance-metrics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,187 @@
#!/bin/bash
#
# Process AIT Performance Metrics
#
# This script processes JSONL-format performance metrics files from AIT test runs
# and generates a markdown file with comparison tables.
#
# Arguments:
# input-dir Directory containing *-metrics-summary.json files (JSONL format)
# output-file Path to output markdown file
# report-title Title for the report (e.g., "Release9.0.0")
#
# JSONL Format:
# Each input file contains one JSON object per line (not a JSON array).
# Each JSON object represents one test result with metadata and metrics.
#
# Output Format:
# Markdown with nested structure:
# - Level 1: Directory (e.g., "server")
# - Level 2: Test File (e.g., "tomcat")
# - Level 3: Test Case (e.g., "test_tomcat")
# Each test case contains a comparison table showing all
# version combinations.
#

set -euo pipefail

if [ $# -ne 3 ]; then
echo "ProcessPerformanceMetrics: Incorrect number of arguments" >&2
echo "ProcessPerformanceMetrics: $0 <input-dir> <output-file> <report-title>" >&2
exit 1
fi

INPUT_DIR="$1"
OUTPUT_FILE="$2"
REPORT_TITLE="$3"

if [ ! -d "$INPUT_DIR" ]; then
echo "ProcessPerformanceMetrics: Input directory does not exist: $INPUT_DIR" >&2
exit 1
fi

if ! command -v jq &> /dev/null; then
echo "ProcessPerformanceMetrics: jq is required but not installed" >&2
exit 1
fi

cat > "$OUTPUT_FILE" << EOF
# Performance Metrics - ${REPORT_TITLE}

Generated: $(date)

EOF

TEMP_FILE=$(mktemp)

trap 'rm -f "$TEMP_FILE"' EXIT

FILE_COUNT=0
LINE_COUNT=0

for file in "$INPUT_DIR"/*-metrics-summary.json; do
if [ -f "$file" ]; then
FILE_COUNT=$((FILE_COUNT + 1))

while IFS= read -r test_result; do
[ -z "$test_result" ] && continue

LINE_COUNT=$((LINE_COUNT + 1))

TEST_NAME=$(echo "$test_result" | jq -r '.metadata.test_name')
JAVA_VERSION=$(echo "$test_result" | jq -r '.metadata.java_version')
FRAMEWORK_VERSION=$(echo "$test_result" | jq -r '.metadata.framework_version // "N/A"')

DIR=$(echo "$TEST_NAME" | cut -d'-' -f1)
REST=$(echo "$TEST_NAME" | cut -d'-' -f2-)
TEST_FILE=$(echo "$REST" | cut -d'.' -f1)
TEST_CASE=$(echo "$REST" | cut -d'.' -f2-)

# dir|test_file|test_case|test_name|java_version|framework_version|json_data
echo "${DIR}|${TEST_FILE}|${TEST_CASE}|${TEST_NAME}|${JAVA_VERSION}|${FRAMEWORK_VERSION}|${test_result}" >> "$TEMP_FILE"
done < "$file"
fi
done

if [ ! -s "$TEMP_FILE" ]; then
echo "ProcessPerformanceMetrics: No test results found in input directory" >&2
echo "No test results found." >> "$OUTPUT_FILE"
exit 0
fi

sort -t'|' -k1,1 -k2,2 -k3,3 -k5,5n -k6,6 "$TEMP_FILE" -o "$TEMP_FILE"

close_test_case() {
if [ -n "$CURRENT_TEST_CASE" ]; then
echo "" >> "$OUTPUT_FILE"
echo "</details>" >> "$OUTPUT_FILE"
echo "</blockquote>" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
fi
}

close_test_file() {
if [ -n "$CURRENT_TEST_FILE" ]; then
echo "" >> "$OUTPUT_FILE"
echo "</details>" >> "$OUTPUT_FILE"
echo "</blockquote>" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
fi
}

close_directory() {
if [ -n "$CURRENT_DIR" ]; then
echo "" >> "$OUTPUT_FILE"
echo "</details>" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
fi
}

CURRENT_DIR=""
CURRENT_TEST_FILE=""
CURRENT_TEST_CASE=""

while IFS='|' read -r DIR TEST_FILE TEST_CASE TEST_NAME JAVA_VERSION FRAMEWORK_VERSION JSON_DATA; do

if [ "$DIR" != "$CURRENT_DIR" ]; then
close_test_case
close_test_file
close_directory

echo "<details>" >> "$OUTPUT_FILE"
echo "<summary><strong> ${DIR}</strong></summary>" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
CURRENT_DIR="$DIR"
CURRENT_TEST_FILE=""
CURRENT_TEST_CASE=""
fi

if [ "$TEST_FILE" != "$CURRENT_TEST_FILE" ]; then
close_test_case
close_test_file

echo "<blockquote>" >> "$OUTPUT_FILE"
echo "<details>" >> "$OUTPUT_FILE"
echo "<summary><strong> ${TEST_FILE}</strong></summary>" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"
CURRENT_TEST_FILE="$TEST_FILE"
CURRENT_TEST_CASE=""
fi

if [ "$TEST_CASE" != "$CURRENT_TEST_CASE" ]; then
close_test_case

echo "<blockquote>" >> "$OUTPUT_FILE"
echo "<details>" >> "$OUTPUT_FILE"
echo "<summary><strong> ${TEST_CASE}</strong></summary>" >> "$OUTPUT_FILE"
echo "" >> "$OUTPUT_FILE"

echo "| Java | Framework | CPU Time (s) | Response Time (s) | Response Count | Throughput | Errors | Heap Max (%) |" >> "$OUTPUT_FILE"
echo "|------|-----------|--------------|-------------------|----------------|------------|--------|--------------|" >> "$OUTPUT_FILE"

CURRENT_TEST_CASE="$TEST_CASE"
fi

CPU_TIME=$(echo "$JSON_DATA" | jq -r '.metrics.cpu_time // "N/A"')
RESP_TIME=$(echo "$JSON_DATA" | jq -r '.metrics.response_time_total // "N/A"')
RESP_COUNT=$(echo "$JSON_DATA" | jq -r '.metrics.response_count // "N/A"')
THROUGHPUT=$(echo "$JSON_DATA" | jq -r '.metrics.throughput // "N/A"')
ERROR_COUNT=$(echo "$JSON_DATA" | jq -r '.metrics.error_count // "N/A"')
HEAP_UTIL=$(echo "$JSON_DATA" | jq -r '.metrics.heap_utilization_max // "0.0"')
HEAP_PRESENT=$(echo "$JSON_DATA" | jq -r '.metrics.heap_metrics_present')

# formatting values
CPU_TIME_FMT=$(printf "%.2f" "$CPU_TIME" 2>/dev/null || echo "$CPU_TIME")
RESP_TIME_FMT=$(printf "%.2f" "$RESP_TIME" 2>/dev/null || echo "$RESP_TIME")
HEAP_UTIL_FMT=$(printf "%.1f%%" "$HEAP_UTIL" 2>/dev/null || echo "0.0%")
if [ "$HEAP_PRESENT" = "false" ] || [ "$HEAP_UTIL" = "0.0" ]; then
HEAP_UTIL_FMT="-"
fi

echo "| ${JAVA_VERSION} | ${FRAMEWORK_VERSION} | ${CPU_TIME_FMT} | ${RESP_TIME_FMT} | ${RESP_COUNT} | ${THROUGHPUT} | ${ERROR_COUNT} | ${HEAP_UTIL_FMT} |" >> "$OUTPUT_FILE"

done < "$TEMP_FILE"

close_test_case
close_test_file
close_directory
Loading
Loading