Skip to content

Commit 5a6392d

Browse files
committed
Improve UI and add flamegraph availability tracking
- Add has_flamegraph field to track flamegraph availability in diff tables - Show flamegraph button only when flamegraph data is actually available - Display environment identifier in binary detail cards for better debugging - Fix API base URL in docker-compose.dev.yml to include /api prefix - Improve layout and styling of environment cards
1 parent 19246ce commit 5a6392d

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

backend/app/routers/benchmarks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ async def get_diff_table(
122122
"metric_key": metric_key,
123123
"curr_python_version_str": f"{selected_commit.python_major}.{selected_commit.python_minor}.{selected_commit.python_patch}",
124124
"curr_result_id": result.id,
125+
"has_flamegraph": result.flamegraph_html is not None,
125126
}
126127

127128
# Try to find previous commit's data for comparison

backend/app/schemas.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class DiffTableRow(BaseModel):
140140
prev_python_version_str: Optional[str] = None
141141
curr_python_version_str: str
142142
curr_result_id: str
143+
has_flamegraph: bool = False
143144

144145

145146
class PythonVersionFilterOption(BaseModel):

docker-compose.dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ services:
4242
image: node:20-alpine
4343
working_dir: /app
4444
environment:
45-
NEXT_PUBLIC_API_BASE: http://localhost:8000
45+
NEXT_PUBLIC_API_BASE: http://localhost:8000/api
4646
ports:
4747
- "9002:9002"
4848
depends_on:

frontend/src/app/binaries/[id]/page.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,16 @@ function EnvironmentCard({
9898
)}
9999
</div>
100100
</div>
101-
<div className="flex items-center gap-2">
102-
<Badge variant="secondary">
103-
{environment.commit_count} commits
104-
</Badge>
105-
<Badge variant="outline">{environment.run_count} runs</Badge>
101+
<div className="flex flex-col items-end gap-2">
102+
<div className="text-xs text-muted-foreground font-mono">
103+
Identifier: {environment.id}
104+
</div>
105+
<div className="flex items-center gap-2">
106+
<Badge variant="secondary">
107+
{environment.commit_count} commits
108+
</Badge>
109+
<Badge variant="outline">{environment.run_count} runs</Badge>
110+
</div>
106111
</div>
107112
</div>
108113
</CardHeader>

frontend/src/app/diff/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ interface EnhancedDiffTableRow {
7474

7575
// Result ID for flamegraph
7676
curr_result_id?: string;
77+
has_flamegraph?: boolean;
7778
}
7879
import CommitTooltipContent from '@/components/diff/CommitTooltipContent';
7980

@@ -348,6 +349,7 @@ function DiffTableContent() {
348349
curr_python_version_str: baseRow.curr_python_version_str,
349350
prev_python_version_str: baseRow.prev_python_version_str,
350351
curr_result_id: baseRow.curr_result_id,
352+
has_flamegraph: baseRow.has_flamegraph,
351353

352354
// High watermark data
353355
high_watermark_curr: hwRow?.curr_metric_value || 0,
@@ -1177,7 +1179,7 @@ function DiffTableContent() {
11771179
{row.total_allocated_curr.toLocaleString()}
11781180
</TableCell>
11791181
<TableCell className="text-center">
1180-
{row.curr_result_id ? (
1182+
{row.curr_result_id && row.has_flamegraph ? (
11811183
<Button
11821184
variant="outline"
11831185
size="sm"

frontend/src/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export type DiffTableRow = {
6767
prev_python_version_str?: string;
6868
curr_python_version_str: string;
6969
curr_result_id: string;
70+
has_flamegraph?: boolean;
7071
};
7172

7273
export type AuthToken = {

0 commit comments

Comments
 (0)