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
75 changes: 75 additions & 0 deletions site/content/leaderboard/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,81 @@ html.dark .http-ver[data-ver="ws"].active { color: #22d3ee; background: rgba(8,1
</script>
</div>

<div id="timeline-link-bar" style="display:flex; margin-top:0.5rem; padding:0.45rem 0.9rem; justify-content:flex-end; align-items:center; gap:0.5rem; font-size:0.8rem; color:#64748b;">
<span id="timeline-link-prefix">📈 Browse historical benchmark results on</span>
<a id="timeline-link"
href="https://kaliumhexacyanoferrat.github.io/HttpArena-Timeline/"
target="_blank" rel="noopener"
style="color:#7c3aed; text-decoration:none; font-weight:600;">HttpArena Timeline →</a>
</div>
<style>
html.dark #timeline-link-bar { color:#94a3b8; }
html.dark #timeline-link { color:#a78bfa; }
#timeline-link:hover { text-decoration:underline; }
</style>
<script>
(function() {
var TIMELINE_BASE = 'https://kaliumhexacyanoferrat.github.io/HttpArena-Timeline/';
/* Per-version: wrapper id and panel class. Composite has no entry here —
it doesn't map onto a single test+conns pair, so the bar keeps the
generic prefix + home URL for that view. */
var VERSION_CFG = {
h1iso: { wrapper: 'lb-h1iso-wrapper', panel: 'lb-panel' },
h1wk: { wrapper: 'lb-h1wk-wrapper', panel: 'lb-panel' },
h2: { wrapper: 'lb-h2-wrapper', panel: 'lb-panel-h2' },
gateway: { wrapper: 'lb-gateway-wrapper', panel: 'lb-panel-gw' },
h3: { wrapper: 'lb-h3-wrapper', panel: 'lb-panel-h3' },
grpc: { wrapper: 'lb-grpc-wrapper', panel: 'lb-panel-grpc' },
ws: { wrapper: 'lb-ws-wrapper', panel: 'lb-panel-ws' }
};
var GENERIC_PREFIX = '📈 Browse historical benchmark results on';
var SPECIFIC_PREFIX = '📈 Track this test over time:';

function setGeneric() {
var p = document.getElementById('timeline-link-prefix');
var l = document.getElementById('timeline-link');
if (p) p.textContent = GENERIC_PREFIX;
if (l) l.href = TIMELINE_BASE;
}

function update() {
var verEl = document.querySelector('.http-ver.active');
var v = verEl ? verEl.dataset.ver : 'composite';
var cfg = VERSION_CFG[v];
if (!cfg) { setGeneric(); return; }
var wrap = document.getElementById(cfg.wrapper);
if (!wrap) { setGeneric(); return; }
var panel = wrap.querySelector('.' + cfg.panel + '.active');
if (!panel || !panel.dataset.panel) { setGeneric(); return; }
var test = panel.dataset.panel;
var connTab = panel.querySelector('.lb-conn-tab.active');
var conns = connTab ? connTab.dataset.conns : null;
if (!conns || conns === 'best') {
/* "Best" aggregates across conn counts; pick the highest numeric
value declared on the panel for the timeline deep link. */
var declared = (panel.dataset.conns || '').split(',')
.filter(function(c) { return /^\d+$/.test(c); })
.map(Number);
if (!declared.length) { setGeneric(); return; }
conns = Math.max.apply(null, declared);
}
var p = document.getElementById('timeline-link-prefix');
var l = document.getElementById('timeline-link');
if (p) p.textContent = SPECIFIC_PREFIX;
if (l) l.href = TIMELINE_BASE + '#test=' + test + '-' + conns;
}

/* Poll once a frame for the first 2 seconds in case shortcode scripts
mutate state asynchronously, then settle into a low-frequency check
that catches any tab/filter interaction we didn't event-hook. */
var ticks = 0;
var fast = setInterval(function() {
update();
if (++ticks > 30) { clearInterval(fast); setInterval(update, 400); }
}, 60);
})();
</script>

<div id="lb-h1iso-wrapper" style="display:none;">
{{< leaderboard-h1-isolated >}}
</div>
Expand Down
3 changes: 3 additions & 0 deletions site/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ menu:
- name: Leaderboard
pageRef: /leaderboard
weight: 1
- name: Timeline
url: https://kaliumhexacyanoferrat.github.io/HttpArena-Timeline/
weight: 1.5
- name: Knowledge Base
pageRef: /docs
weight: 2
Expand Down