cache status for monitor
2 changed files+29−1
benchcompress/src/benchcompress/run_benchmarks.pymodified+2−0View file
@@ -235,6 +235,7 @@ def run_benchmarks(
235235 and result.get("system_version", "") == system_version
236236 ):
237237 print(" Using cached result:")
238+ result["cache_status"] = "cached"
238239 results.append(result)
239240 continue
240241
@@ -392,6 +393,7 @@ def run_benchmarks(
392393 "array_shape": data.shape,
393394 "array_dtype": dtype,
394395 "timestamp": time.time(),
396+ "cache_status": "new",
395397 }
396398 results.append(result)
397399
web-ui/src/pages/Monitor.tsxmodified+27−1View file
@@ -15,6 +15,7 @@ interface BenchmarkStatus {
1515 compression_ratio: number;
1616 encode_time: number;
1717 decode_time: number;
18+ cache_status: string;
1819 }>;
1920 }
2021
@@ -179,6 +180,15 @@ export default function Monitor() {
179180 >
180181 Decode Time (ms)
181182 </th>
183+ <th
184+ style={{
185+ padding: "12px",
186+ textAlign: "center",
187+ borderBottom: "2px solid #ddd",
188+ }}
189+ >
190+ Cache Status
191+ </th>
182192 </tr>
183193 </thead>
184194 <tbody>
@@ -186,7 +196,12 @@ export default function Monitor() {
186196 <tr
187197 key={index}
188198 style={{
189- backgroundColor: index % 2 === 0 ? "white" : "#fafafa",
199+ backgroundColor:
200+ benchmark.cache_status === "cached"
201+ ? "#f5f5f5"
202+ : index % 2 === 0
203+ ? "white"
204+ : "#fafafa",
190205 }}
191206 >
192207 <td
@@ -226,6 +241,17 @@ export default function Monitor() {
226241 >
227242 {(benchmark.decode_time * 1000).toFixed(2)}
228243 </td>
244+ <td
245+ style={{
246+ padding: "12px",
247+ textAlign: "center",
248+ borderBottom: "1px solid #ddd",
249+ color:
250+ benchmark.cache_status === "cached" ? "#888" : "#000",
251+ }}
252+ >
253+ {benchmark.cache_status}
254+ </td>
229255 </tr>
230256 ))}
231257 </tbody>