chore(scripts): realistic ClickHouse seed data and quieter output#6676
Draft
macko911 wants to merge 1 commit into
Draft
chore(scripts): realistic ClickHouse seed data and quieter output#6676macko911 wants to merge 1 commit into
macko911 wants to merge 1 commit into
Conversation
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>
Contributor
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 5/5
- In
scripts/seed-clickhouse.ts, thedayScale < 0.45skip threshold appears unreachable for normal--daysinputs, 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)) { |
Contributor
There was a problem hiding this comment.
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)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm run seed:clickhouseoutput (success line only);--verbosefor per-env progress and library logsdebug; one summaryinfoline when migrations runTest plan
npm run seed:clickhouse— single-line success outputnpm run seed:clickhouse -- --verbose— full progress + migration logsMade with Cursor