Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,14 @@ The shared Rust benchmark nightly invocation measures both targets in quick mode

## Nightly trends

The trend site will be at <https://moq-dev.github.io/moq/bench/> once the
maintainer enables GitHub Pages with **Source: GitHub Actions**. The Nightly
The trend site is at <https://git.moq.dev/bench/>, linked from the
[nightly reports](https://git.moq.dev/) root with every other report. The Nightly
workflow keeps history on one `gh-pages` branch and deploys the generated
`github-action-benchmark` charts explicitly. The publisher runs only on `main`,
serializes history writes, and leaves regression alerts and comments disabled.
Enabling Pages is a separate repository setting; merging the workflow does not
change it. Until it is enabled, the Nightly's Benchmark site job still records
history on `gh-pages`, then fails at deployment.
Re-running its job in place fails, because the earlier attempt's
`github-pages` artifact remains; delete that artifact first or wait for the
next Nightly.

The charts include these measurements:

Expand Down
2 changes: 1 addition & 1 deletion sh/gh/bench-publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ case ${1:-} in
fi
git worktree add "$2" gh-pages
just gh benchmark-report index "$2"
git -C "$2" add bench/index.html .nojekyll
git -C "$2" add index.html bench/index.html .nojekyll
if ! git -C "$2" diff --cached --quiet; then
git -C "$2" -c user.name=github-actions -c user.email=github-actions@users.noreply.github.com \
commit -m 'Update benchmark landing page'
Expand Down
15 changes: 15 additions & 0 deletions sh/gh/bench-report.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ def index(directory):
<p>Each series keeps its source and payload shape. A failed suite contributes no point.
<a href="https://github.com/moq-dev/moq/blob/main/bench/README.md">Metrics and local reproduction</a></p>
</html>
''')
# gh-pages hosts every nightly report, each in its own directory with its own writer.
reports = []
for page in sorted(directory.glob('*/index.html')):
title = re.search(r'<title>(.*?)</title>', page.read_text(), re.S)
label = title.group(1).strip() if title else page.parent.name
reports.append(f'<li><a href="{page.parent.name}/">{html.escape(label)}</a></li>')
(directory / 'index.html').write_text('''<!doctype html>
<html lang="en"><meta charset="utf-8"><meta name="viewport" content="width=device-width">
<title>MoQ nightly reports</title>
<style>body{font:18px system-ui;max-width:48rem;margin:4rem auto;padding:0 1rem;line-height:1.6}a{color:#066fbb}</style>
<h1>MoQ nightly reports</h1>
<ul>''' + ''.join(reports) + '''</ul>
<p><a href="https://github.com/moq-dev/moq/actions/workflows/nightly.yml">Nightly runs</a></p>
</html>
''')
(directory / '.nojekyll').touch()

Expand Down
7 changes: 7 additions & 0 deletions sh/gh/bench-report.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,13 @@ def test_landing_page_keeps_existing_charts_and_history(self):
(chart / 'data.js').write_text('history')
report.index(self.root)
self.assertIn('costs/', (chart.parent / 'index.html').read_text())
relays = self.root / 'relays'
relays.mkdir()
(relays / 'index.html').write_text('<title>Relay smoke</title>')
report.index(self.root)
landing = (self.root / 'index.html').read_text()
self.assertIn('<a href="bench/">MoQ benchmarks</a>', landing)
self.assertIn('<a href="relays/">Relay smoke</a>', landing)
self.assertEqual((chart / 'data.js').read_text(), 'history')
self.assertTrue((self.root / '.nojekyll').exists())

Expand Down