← back to Exo
dashboard fix limit
062f5e3e29f61bfbd4cf78fb15301d0e1d0d9d85 · 2024-11-25 17:45:29 +0400 · Alex Cheema
Files touched
M extra/dashboard/dashboard.py
Diff
commit 062f5e3e29f61bfbd4cf78fb15301d0e1d0d9d85
Author: Alex Cheema <alexcheema123@gmail.com>
Date: Mon Nov 25 17:45:29 2024 +0400
dashboard fix limit
---
extra/dashboard/dashboard.py | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/extra/dashboard/dashboard.py b/extra/dashboard/dashboard.py
index 6150ad60..4067ac18 100644
--- a/extra/dashboard/dashboard.py
+++ b/extra/dashboard/dashboard.py
@@ -9,7 +9,6 @@ from typing import List, Dict, Optional
from pathlib import Path
from plotly.subplots import make_subplots
import plotly.graph_objects as go
-from datetime import datetime, timedelta
class AsyncCircleCIClient:
def __init__(self, token: str, project_slug: str):
@@ -71,10 +70,6 @@ class AsyncCircleCIClient:
)
pipelines.extend(next_pipelines)
- # Trim to limit if needed
- if limit is not None:
- pipelines = pipelines[:limit]
-
return pipelines
async def get_workflow_jobs(self, session: aiohttp.ClientSession, pipeline_id: str) -> List[Dict]:
@@ -197,7 +192,7 @@ class PackageSizeTracker:
benchmark_data = await self.client.get_json(session, benchmark_report["url"])
data_point.update({
"tokens_per_second": benchmark_data["tokens_per_second"],
- "time_to_first_token": benchmark_data["time_to_first_token"]
+ "time_to_first_token": benchmark_data.get("time_to_first_token", 0)
})
self.logger.info(
f"Processed benchmark data for pipeline {pipeline['id']}: "
@@ -270,8 +265,6 @@ class PackageSizeTracker:
pipelines = main_pipelines + circleci_pipelines
# Sort pipelines by created_at date
pipelines.sort(key=lambda x: x.get("created_at", x.get("updated_at")), reverse=True)
- # Take the 20 most recent pipelines after combining
- pipelines = pipelines[:20]
self.logger.info(f"Found {len(pipelines)} recent pipelines")
@@ -302,7 +295,7 @@ class PackageSizeTracker:
# Create a single figure with subplots
fig = make_subplots(
rows=3, cols=2,
- subplot_titles=('Test Status', 'Package Size Trend', '', 'Line Count Trend', '', 'Tokens per Second'),
+ subplot_titles=('Test Status', 'Package Size', '', 'Line Count', '', 'Tokens per Second'),
vertical_spacing=0.2,
column_widths=[0.2, 0.8],
specs=[[{"type": "indicator"}, {"type": "scatter"}],
@@ -487,6 +480,10 @@ class PackageSizeTracker:
gap: 20px;
}}
+ .chart-row-full {{
+ grid-column: 2 / -1;
+ }}
+
.chart-box {{
background: white;
border-radius: 12px;
@@ -542,15 +539,15 @@ class PackageSizeTracker:
</div>
<div class="chart-row">
<div class="chart-box">
- <div class="chart-title">Package Size Trend</div>
+ <div class="chart-title">Package Size</div>
<div id="size-chart"></div>
</div>
<div class="chart-box">
- <div class="chart-title">Line Count Trend</div>
+ <div class="chart-title">Line Count</div>
<div id="lines-chart"></div>
</div>
</div>
- <div class="chart-row">
+ <div class="chart-row chart-row-full">
<div class="chart-box">
<div class="chart-title">Tokens per Second</div>
<div id="tokens-chart"></div>
@@ -880,7 +877,8 @@ class PackageSizeTracker:
if 'tokens_per_second' in latest_data:
print("\nBenchmark Stats:")
print(f"Tokens per Second: {latest_data['tokens_per_second']:.2f}")
- print(f"Time to First Token: {latest_data['time_to_first_token']:.3f}s")
+ if 'time_to_first_token' in latest_data:
+ print(f"Time to First Token: {latest_data['time_to_first_token']:.3f}s")
print("\n")
← 6f8582d8 nice dashboard, add benchmark results tokens per second
·
back to Exo
·
add notification sounds ca8d59a2 →