Skip to content

Commit 92d8508

Browse files
committed
ci: log experiment
1 parent a899f49 commit 92d8508

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

.github/workflows/build-overhead-experiment.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,11 @@ jobs:
3232
cd .github/workflows/experiments
3333
./compute_build_overhead.sh pdfbox
3434
35+
- name: Upload build logs
36+
if: always()
37+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
38+
with:
39+
name: build-overhead-logs
40+
path: .github/workflows/experiments/build-logs/
41+
retention-days: 30
42+

.github/workflows/experiments/compute_build_overhead.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ fi
1212
PROGRAM=$1
1313

1414
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15+
LOGS_DIR="$SCRIPT_DIR/build-logs"
16+
mkdir -p "$LOGS_DIR"
1517

1618
case $PROGRAM in
1719
pdfbox)
@@ -64,7 +66,12 @@ esac
6466
cd "$PROJECT_DIR" || exit 1
6567
# Measure baseline build time
6668
echo "Measuring baseline build time..."
67-
BASELINE_TIME=$( { time mvn clean package -DskipTests; } 2>&1 | grep real | awk '{print $2}' )
69+
echo "::group::Baseline Build Logs"
70+
BASELINE_OUTPUT=$( { time mvn clean package -DskipTests 2>&1; } )
71+
echo "$BASELINE_OUTPUT"
72+
echo "$BASELINE_OUTPUT" > "$LOGS_DIR/${PROGRAM}-baseline-build.log"
73+
echo "::endgroup::"
74+
BASELINE_TIME=$(echo "$BASELINE_OUTPUT" | grep real | awk '{print $2}')
6875

6976
cp $PROJECT_DIR/$POM_FILE $PROJECT_DIR/$POM_FILE.bak
7077

@@ -73,7 +80,12 @@ echo "Adding classport-maven-plugin to pom.xml..."
7380

7481
# Measure plugin execution time
7582
echo "Measuring plugin execution time..."
76-
PLUGIN_TIME=$( { time mvn clean package -DskipTests; } 2>&1 | grep real | awk '{print $2}' )
83+
echo "::group::Plugin Build Logs"
84+
PLUGIN_OUTPUT=$( { time mvn clean package -DskipTests 2>&1; } )
85+
echo "$PLUGIN_OUTPUT"
86+
echo "$PLUGIN_OUTPUT" > "$LOGS_DIR/${PROGRAM}-plugin-build.log"
87+
echo "::endgroup::"
88+
PLUGIN_TIME=$(echo "$PLUGIN_OUTPUT" | grep real | awk '{print $2}')
7789

7890
mv $PROJECT_DIR/$POM_FILE.bak $PROJECT_DIR/$POM_FILE
7991

@@ -91,3 +103,13 @@ echo "Plugin execution time: $PLUGIN_TIME"
91103
echo "Overhead introduced by the plugin: ${OVERHEAD}s"
92104
echo "Percentage overhead: ${PERCENTAGE_OVERHEAD}%"
93105

106+
# Save summary to file
107+
SUMMARY_FILE="$LOGS_DIR/${PROGRAM}-summary.txt"
108+
cat > "$SUMMARY_FILE" << EOF
109+
Build Overhead Summary for $PROGRAM
110+
====================================
111+
Baseline build time: $BASELINE_TIME
112+
Plugin execution time: $PLUGIN_TIME
113+
Overhead introduced by the plugin: ${OVERHEAD}s
114+
Percentage overhead: ${PERCENTAGE_OVERHEAD}%
115+
EOF
Submodule pdfbox-3.0.4 deleted from 332d161

0 commit comments

Comments
 (0)