Skip to content

Commit efdd64f

Browse files
committed
fix(webapp): include rollup tables in the queue metrics simulator reset
The simulator's --reset only cleared the raw and 10s tables, leaving stale rows in the 5m and env rollups. It also force-merges the rollups after seeding so current-value widgets read cleanly.
1 parent df0bbe1 commit efdd64f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

apps/webapp/seed-queue-metrics.mts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,12 @@ async function resetEnv(ch: ClickHouse, environmentId: string) {
346346
const raw = (
347347
ch.writer as unknown as { client: { command: (a: { query: string }) => Promise<unknown> } }
348348
).client;
349-
for (const table of ["queue_metrics_raw_v1", "queue_metrics_v1"]) {
349+
for (const table of [
350+
"queue_metrics_raw_v1",
351+
"queue_metrics_v1",
352+
"queue_metrics_5m_v1",
353+
"env_metrics_v1",
354+
]) {
350355
await raw.command({
351356
query: `DELETE FROM trigger_dev.${table} WHERE environment_id = '${environmentId}'`,
352357
});
@@ -511,6 +516,8 @@ async function main() {
511516
ch.writer as unknown as { client: { command: (a: { query: string }) => Promise<unknown> } }
512517
).client;
513518
await raw.command({ query: `OPTIMIZE TABLE trigger_dev.queue_metrics_v1 FINAL` });
519+
await raw.command({ query: `OPTIMIZE TABLE trigger_dev.queue_metrics_5m_v1 FINAL` });
520+
await raw.command({ query: `OPTIMIZE TABLE trigger_dev.env_metrics_v1 FINAL` });
514521

515522
const origin = process.env.APP_ORIGIN ?? "http://localhost:3030";
516523
console.log(

0 commit comments

Comments
 (0)