Skip to content

Commit 9d34bc8

Browse files
authored
Merge pull request #649 from louis-e/benchmark-datetime
Add date time in benchmark comment
2 parents 57a4a80 + c95b78f commit 9d34bc8

File tree

2 files changed

+9
-36
lines changed

2 files changed

+9
-36
lines changed

.github/workflows/pr-benchmark.yml

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout code
23-
uses: actions/checkout@v5
23+
uses: actions/checkout@v6
2424

2525
- name: Set up Rust
2626
uses: dtolnay/rust-toolchain@v1
@@ -43,7 +43,7 @@ jobs:
4343
- name: Run benchmark command with memory tracking
4444
id: benchmark
4545
run: |
46-
/usr/bin/time -v ./target/release/arnis --path="./world" --terrain --generate-map --bbox="48.125768 11.552296 48.148565 11.593838" 2> benchmark_log.txt
46+
/usr/bin/time -v ./target/release/arnis --path="./world" --terrain --bbox="48.125768 11.552296 48.148565 11.593838" 2> benchmark_log.txt
4747
grep "Maximum resident set size" benchmark_log.txt | awk '{print $6}' > peak_mem_kb.txt
4848
peak_kb=$(cat peak_mem_kb.txt)
4949
peak_mb=$((peak_kb / 1024))
@@ -57,25 +57,6 @@ jobs:
5757
duration=$((end_time - start_time))
5858
echo "duration=$duration" >> $GITHUB_OUTPUT
5959
60-
- name: Check for map preview
61-
id: map_check
62-
run: |
63-
if [ -f "./world/arnis_world_map.png" ]; then
64-
echo "Map preview generated successfully"
65-
echo "map_exists=true" >> $GITHUB_OUTPUT
66-
else
67-
echo "Map preview not found"
68-
echo "map_exists=false" >> $GITHUB_OUTPUT
69-
fi
70-
71-
- name: Upload map preview as artifact
72-
if: steps.map_check.outputs.map_exists == 'true'
73-
uses: actions/upload-artifact@v4
74-
with:
75-
name: world-map-preview
76-
path: ./world/arnis_world_map.png
77-
retention-days: 60
78-
7960
- name: Format duration and generate summary
8061
id: comment_body
8162
run: |
@@ -106,27 +87,20 @@ jobs:
10687
mem_annotation=" (↗ ${mem_percent}% more)"
10788
fi
10889
109-
# Get current timestamp
11090
benchmark_time=$(date -u "+%Y-%m-%d %H:%M:%S UTC")
111-
run_url="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
11291
11392
{
11493
echo "summary<<EOF"
115-
echo "## ⏱️ Benchmark Results"
94+
echo "⏱️ Benchmark run finished in **${minutes}m ${seconds}s**"
95+
echo "🧠 Peak memory usage: **${peak_mem} MB**${mem_annotation}"
11696
echo ""
117-
echo "| Metric | Value |"
118-
echo "|--------|-------|"
119-
echo "| Duration | **${minutes}m ${seconds}s** |"
120-
echo "| Peak Memory | **${peak_mem} MB**${mem_annotation} |"
121-
echo "| Baseline | **${baseline_time}s** |"
122-
echo "| Delta | **${diff}s** |"
123-
echo "| Commit | [\`${GITHUB_SHA:0:7}\`](https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}) |"
97+
echo "📈 Compared against baseline: **${baseline_time}s**"
98+
echo "🧮 Delta: **${diff}s**"
99+
echo "🔢 Commit: [\`${GITHUB_SHA:0:7}\`](https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA})"
124100
echo ""
125101
echo "${verdict}"
126102
echo ""
127-
echo "---"
128-
echo ""
129-
echo "📅 **Last benchmark:** ${benchmark_time} | 📥 [Download generated world map](${run_url}#artifacts)"
103+
echo "📅 **Last benchmark:** ${benchmark_time}"
130104
echo ""
131105
echo "_You can retrigger the benchmark by commenting \`retrigger-benchmark\`._"
132106
echo "EOF"
@@ -138,4 +112,4 @@ jobs:
138112
message: ${{ steps.comment_body.outputs.summary }}
139113
comment-tag: benchmark-report
140114
env:
141-
GITHUB_TOKEN: ${{ secrets.BENCHMARK_TOKEN }}
115+
GITHUB_TOKEN: ${{ secrets.BENCHMARK_TOKEN }}

src/gui.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ fn gui_start_generation(
876876
&mut xzbbox,
877877
&mut ground,
878878
);
879-
send_log(LogLevel::Info, "Map transformation completed.");
880879

881880
let _ = data_processing::generate_world(
882881
parsed_elements,

0 commit comments

Comments
 (0)