|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <meta charset="utf-8"> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | + <title>Benchmark Results</title> |
| 7 | + <style> |
| 8 | + body { |
| 9 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; |
| 10 | + margin: 0; |
| 11 | + padding: 16px; |
| 12 | + background: #f8f9fa; |
| 13 | + } |
| 14 | + .container { |
| 15 | + max-width: 1100px; |
| 16 | + margin: 0 auto; |
| 17 | + } |
| 18 | + h1, h2 { |
| 19 | + color: #212529; |
| 20 | + text-align: center; |
| 21 | + margin-bottom: 24px; |
| 22 | + font-weight: 500; |
| 23 | + } |
| 24 | + .chart { |
| 25 | + background: white; |
| 26 | + border-radius: 8px; |
| 27 | + padding: 24px; |
| 28 | + margin-bottom: 24px; |
| 29 | + box-shadow: 0 1px 3px rgba(0,0,0,0.1); |
| 30 | + overflow-x: auto; |
| 31 | + } |
| 32 | + .chart > div { |
| 33 | + min-width: 600px; |
| 34 | + margin: 0 auto; |
| 35 | + } |
| 36 | + @media (max-width: 768px) { |
| 37 | + body { |
| 38 | + padding: 12px; |
| 39 | + } |
| 40 | + .chart { |
| 41 | + padding: 16px; |
| 42 | + border-radius: 6px; |
| 43 | + } |
| 44 | + h1 { |
| 45 | + font-size: 24px; |
| 46 | + margin-bottom: 16px; |
| 47 | + } |
| 48 | + } |
| 49 | + .filter-container { |
| 50 | + text-align: center; |
| 51 | + margin-bottom: 24px; |
| 52 | + } |
| 53 | + .filter-container input { |
| 54 | + padding: 8px; |
| 55 | + font-size: 16px; |
| 56 | + border: 1px solid #ccc; |
| 57 | + border-radius: 4px; |
| 58 | + width: 400px; |
| 59 | + max-width: 100%; |
| 60 | + } |
| 61 | + .suite-filter-container { |
| 62 | + text-align: center; |
| 63 | + margin-bottom: 24px; |
| 64 | + padding: 16px; |
| 65 | + background: #e9ecef; |
| 66 | + border-radius: 8px; |
| 67 | + } |
| 68 | + .suite-checkbox { |
| 69 | + margin: 0 8px; |
| 70 | + } |
| 71 | + details { |
| 72 | + margin-bottom: 24px; |
| 73 | + } |
| 74 | + summary { |
| 75 | + font-size: 18px; |
| 76 | + font-weight: 500; |
| 77 | + cursor: pointer; |
| 78 | + padding: 12px; |
| 79 | + background: #e9ecef; |
| 80 | + border-radius: 8px; |
| 81 | + user-select: none; |
| 82 | + } |
| 83 | + summary:hover { |
| 84 | + background: #dee2e6; |
| 85 | + } |
| 86 | + </style> |
| 87 | + <script> |
| 88 | + function getQueryParam(param) { |
| 89 | + const urlParams = new URLSearchParams(window.location.search); |
| 90 | + return urlParams.get(param); |
| 91 | + } |
| 92 | + |
| 93 | + function filterCharts() { |
| 94 | + const regexInput = document.getElementById('bench-filter').value; |
| 95 | + const regex = new RegExp(regexInput, 'i'); |
| 96 | + const activeSuites = Array.from(document.querySelectorAll('.suite-checkbox:checked')).map(checkbox => checkbox.getAttribute('data-suite')); |
| 97 | + const charts = document.querySelectorAll('.chart'); |
| 98 | + |
| 99 | + charts.forEach(chart => { |
| 100 | + const label = chart.getAttribute('data-label'); |
| 101 | + const suite = chart.getAttribute('data-suite'); |
| 102 | + if (regex.test(label) && activeSuites.includes(suite)) { |
| 103 | + chart.style.display = ''; |
| 104 | + } else { |
| 105 | + chart.style.display = 'none'; |
| 106 | + } |
| 107 | + }); |
| 108 | + |
| 109 | + updateURL(); |
| 110 | + } |
| 111 | + |
| 112 | + function updateURL() { |
| 113 | + const url = new URL(window.location); |
| 114 | + const regex = document.getElementById('bench-filter').value; |
| 115 | + const activeSuites = Array.from(document.querySelectorAll('.suite-checkbox:checked')).map(checkbox => checkbox.getAttribute('data-suite')); |
| 116 | + |
| 117 | + if (regex) { |
| 118 | + url.searchParams.set('regex', regex); |
| 119 | + } else { |
| 120 | + url.searchParams.delete('regex'); |
| 121 | + } |
| 122 | + |
| 123 | + if (activeSuites.length > 0) { |
| 124 | + url.searchParams.set('suites', activeSuites.join(',')); |
| 125 | + } else { |
| 126 | + url.searchParams.delete('suites'); |
| 127 | + } |
| 128 | + |
| 129 | + history.replaceState(null, '', url); |
| 130 | + } |
| 131 | + |
| 132 | + document.addEventListener('DOMContentLoaded', (event) => { |
| 133 | + const regexParam = getQueryParam('regex'); |
| 134 | + const suitesParam = getQueryParam('suites'); |
| 135 | + |
| 136 | + if (regexParam) { |
| 137 | + document.getElementById('bench-filter').value = regexParam; |
| 138 | + } |
| 139 | + |
| 140 | + const suiteCheckboxes = document.querySelectorAll('.suite-checkbox'); |
| 141 | + if (suitesParam) { |
| 142 | + const suites = suitesParam.split(','); |
| 143 | + suiteCheckboxes.forEach(checkbox => { |
| 144 | + if (suites.includes(checkbox.getAttribute('data-suite'))) { |
| 145 | + checkbox.checked = true; |
| 146 | + } else { |
| 147 | + checkbox.checked = false; |
| 148 | + } |
| 149 | + }); |
| 150 | + } else { |
| 151 | + suiteCheckboxes.forEach(checkbox => { |
| 152 | + checkbox.checked = true; |
| 153 | + }); |
| 154 | + } |
| 155 | + filterCharts(); |
| 156 | + |
| 157 | + suiteCheckboxes.forEach(checkbox => { |
| 158 | + checkbox.addEventListener('change', () => { |
| 159 | + filterCharts(); |
| 160 | + }); |
| 161 | + }); |
| 162 | + |
| 163 | + document.getElementById('bench-filter').addEventListener('input', () => { |
| 164 | + filterCharts(); |
| 165 | + }); |
| 166 | + }); |
| 167 | + </script> |
| 168 | +</head> |
| 169 | +<body> |
| 170 | + <div class="container"> |
| 171 | + <h1>Benchmark Results</h1> |
| 172 | + <div class="filter-container"> |
| 173 | + <input type="text" id="bench-filter" placeholder="Regex..."> |
| 174 | + </div> |
| 175 | + <div class="suite-filter-container"> |
| 176 | + ${suite_checkboxes_html} |
| 177 | + </div> |
| 178 | + <details class="timeseries"> |
| 179 | + <summary>Historical Results</summary> |
| 180 | + <div class="charts"> |
| 181 | + ${timeseries_charts_html} |
| 182 | + </div> |
| 183 | + </details> |
| 184 | + <details class="bar-charts"> |
| 185 | + <summary>Comparisons</summary> |
| 186 | + <div class="charts"> |
| 187 | + ${bar_charts_html} |
| 188 | + </div> |
| 189 | + </details> |
| 190 | + </div> |
| 191 | +</body> |
| 192 | +</html> |
0 commit comments