Skip to content
Draft
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
5 changes: 5 additions & 0 deletions .changeset/trace-search-mv-indicator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/app': patch
---

feat: the trace search Throughput, Errors and Duration charts show whether a materialized view accelerated them, with the same indicator and explanation dialog dashboard tiles use
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export function TraceRedMetricsChart({
sourceId: source.id,
enabled: isReady,
showDisplaySwitcher: false,
showMVOptimizationIndicator: false,
// Same acceleration indicator dashboard tiles show. The date-range one
// stays off: the search range is exact even when a view serves the tile.
showDateRangeIndicator: false,
queryKeyPrefix,
onTimeRangeSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,4 +142,15 @@ describe('TraceRedMetricsChart', () => {
),
).toEqual(new Set(['Duration']));
});

it('shows the acceleration indicator on every RED tile, without the date-range one', () => {
renderChart('red');

expect(mockTimeChartProps.length).toBeGreaterThan(0);
for (const props of mockTimeChartProps) {
// Left unset, DBTimeChart shows the indicator, as on dashboard tiles.
expect(props.showMVOptimizationIndicator).not.toBe(false);
expect(props.showDateRangeIndicator).toBe(false);
}
});
});
27 changes: 27 additions & 0 deletions packages/app/tests/e2e/features/materialized-views.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,33 @@ test.describe(
await expect(aggTable).toContainText('count');
});

test('trace search RED charts show that the view accelerated them', async ({
page,
}) => {
const searchPage = new SearchPage(page);
const mvComponent = new MaterializedViewComponent(page);

await searchPage.goto();
await searchPage.selectSource(DEFAULT_TRACES_MV_SOURCE_NAME);
// One-minute buckets, the view's granularity.
await searchPage.timePicker.selectRelativeTime('Last 1 hour');

// Throughput, Errors and Duration each read the view: counts by status,
// the error ratio, and avg/p95/p99 of Duration are all pre-aggregated.
const indicators = mvComponent.getIndicator();
await expect(indicators).toHaveCount(3, { timeout: 15000 });
for (const indicator of await indicators.all()) {
await expect(indicator).toHaveAttribute('data-mv-accelerated', 'true', {
timeout: 15000,
});
}

// The dialog explains which view served the chart.
await indicators.first().click();
await expect(mvComponent.getModal()).toBeVisible({ timeout: 10000 });
await expect(mvComponent.getModalItem(E2E_TRACES_MV_TABLE)).toBeVisible();
});

test(
'Configuring an MV with auto-population in the source form',
{ tag: '@sources' },
Expand Down
Loading