Skip to content

chore(scripts): realistic ClickHouse seed data and quieter output#6676

Draft
macko911 wants to merge 1 commit into
masterfrom
matej/seed-clickhouse-realistic-data
Draft

chore(scripts): realistic ClickHouse seed data and quieter output#6676
macko911 wants to merge 1 commit into
masterfrom
matej/seed-clickhouse-realistic-data

Conversation

@macko911

Copy link
Copy Markdown
Contributor

Summary

  • Add gradual connection growth (per-integration 10–20% over the seed window), weekend traffic dips, and day-to-day jitter for flow metrics (runs, records, function time, proxy, etc.)
  • Quiet default npm run seed:clickhouse output (success line only); --verbose for per-env progress and library logs
  • Demote per-migration ClickHouse logs to debug; one summary info line when migrations run

Test plan

  • npm run seed:clickhouse — single-line success output
  • npm run seed:clickhouse -- --verbose — full progress + migration logs
  • Billing dashboard shows upward connection trend and weekend dips on flow metrics

Made with Cursor

Shape synthetic usage with gradual connection growth, weekend traffic dips,
and day-to-day variation on flow metrics. Quiet default seed output via a
preload log-level hook and --verbose flag; demote per-migration ClickHouse
logs to debug.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files

Confidence score: 5/5

  • In scripts/seed-clickhouse.ts, the dayScale < 0.45 skip threshold appears unreachable for normal --days inputs, so the “quietest-day” seeding behavior likely never runs and seeded traffic patterns may be less realistic than intended; adjust the threshold or scaling math (or add a small test/assertion around expected activation) before merging to de-risk future confusion.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="scripts/seed-clickhouse.ts">

<violation number="1" location="scripts/seed-clickhouse.ts:273">
P3: The `dayScale < 0.45` threshold for connection skipping is unreachable with the script's default `--days 30` (min ~0.57) and even `--days 60` (min ~0.48). The intended quietest-day behavior only activates with unusually long seed windows (90+ days). Either lower the threshold to match the actual dayScale range (~0.48–0.57 for practical windows) or remove the branch if the behavior isn't needed.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic


for (const connectionId of connections) {
// Skip a fraction of connections on the quietest days only.
if (dayScale < 0.45 && chance(0.2)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: The dayScale < 0.45 threshold for connection skipping is unreachable with the script's default --days 30 (min ~0.57) and even --days 60 (min ~0.48). The intended quietest-day behavior only activates with unusually long seed windows (90+ days). Either lower the threshold to match the actual dayScale range (~0.48–0.57 for practical windows) or remove the branch if the behavior isn't needed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/seed-clickhouse.ts, line 273:

<comment>The `dayScale < 0.45` threshold for connection skipping is unreachable with the script's default `--days 30` (min ~0.57) and even `--days 60` (min ~0.48). The intended quietest-day behavior only activates with unusually long seed windows (90+ days). Either lower the threshold to match the actual dayScale range (~0.48–0.57 for practical windows) or remove the branch if the behavior isn't needed.</comment>

<file context>
@@ -169,38 +242,56 @@ function event(
 
         for (const connectionId of connections) {
+            // Skip a fraction of connections on the quietest days only.
+            if (dayScale < 0.45 && chance(0.2)) {
+                continue;
+            }
</file context>
Suggested change
if (dayScale < 0.45 && chance(0.2)) {
if (dayScale < 0.55 && chance(0.2)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant