-
Notifications
You must be signed in to change notification settings - Fork 1
5s interval #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5s interval #130
Conversation
WalkthroughReplaced hard-coded watch polling durations with a new centralized constant Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (24)
🚧 Files skipped from review as they are similar to previous changes (17)
🧰 Additional context used🧬 Code graph analysis (5)pkg/cmd/get/inventory/providers.go (1)
pkg/cmd/get/plan/list.go (1)
pkg/cmd/get/hook/list.go (1)
pkg/cmd/get/inventory/folders.go (1)
pkg/cmd/get/inventory/vms.go (1)
🔇 Additional comments (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
pkg/cmd/get/hook/list.go (1)
253-257: Watch interval reduced appropriately.The reduction from 15s to 5s makes watch mode more responsive. However, consider that this increases API polling frequency by 3x, which could impact API server load in environments with many concurrent watch sessions.
If this change was prompted by user feedback about responsiveness, you might consider making the interval configurable via a flag (e.g.,
--watch-interval) to allow users to balance responsiveness against resource consumption based on their needs.pkg/cmd/get/inventory/openstack.go (1)
16-21: OpenStack watchers standardized to 5s; consider a shared interval constantAll OpenStack
List*WithInsecurewatchers now poll every 5s, which is consistent with the rest of the codebase and keeps the underlying list logic untouched. Since this file repeats5*time.Secondmany times, you might optionally introduce aconst(e.g.,defaultWatchInterval = 5 * time.Second) or reuse a shared value from thewatchpackage to avoid magic numbers and ease future tuning.Also applies to: 95-100, 176-181, 259-264, 336-341, 418-423, 495-500, 576-581
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (23)
pkg/cmd/get/hook/list.go(1 hunks)pkg/cmd/get/host/list.go(1 hunks)pkg/cmd/get/inventory/clusters.go(1 hunks)pkg/cmd/get/inventory/datacenters.go(1 hunks)pkg/cmd/get/inventory/datastores.go(1 hunks)pkg/cmd/get/inventory/datavolumes.go(1 hunks)pkg/cmd/get/inventory/disks.go(1 hunks)pkg/cmd/get/inventory/ec2.go(4 hunks)pkg/cmd/get/inventory/folders.go(1 hunks)pkg/cmd/get/inventory/hosts.go(1 hunks)pkg/cmd/get/inventory/namespaces.go(1 hunks)pkg/cmd/get/inventory/networks.go(1 hunks)pkg/cmd/get/inventory/openstack.go(8 hunks)pkg/cmd/get/inventory/profiles.go(2 hunks)pkg/cmd/get/inventory/providers.go(1 hunks)pkg/cmd/get/inventory/pvcs.go(1 hunks)pkg/cmd/get/inventory/resource_pools.go(1 hunks)pkg/cmd/get/inventory/storage.go(1 hunks)pkg/cmd/get/inventory/vms.go(1 hunks)pkg/cmd/get/mapping/list.go(1 hunks)pkg/cmd/get/plan/list.go(1 hunks)pkg/cmd/get/plan/vms.go(1 hunks)pkg/cmd/get/provider/list.go(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test kubectl-mtv
🔇 Additional comments (21)
pkg/cmd/get/host/list.go (1)
227-227: LGTM - Consistent polling interval.The watch interval reduction from 15s to 5s aligns with the PR's objective to standardize polling across all watch-enabled list commands.
pkg/cmd/get/inventory/networks.go (1)
51-51: LGTM - Consistent polling interval.pkg/cmd/get/provider/list.go (1)
395-395: Verify the performance impact of increased polling frequency.The interval reduction from 15s to 5s improves responsiveness but triples the API call rate. Ensure that the Kubernetes API server and inventory services can handle the increased load, especially with multiple concurrent watchers.
Consider monitoring backend API call volumes and response times after deployment to validate that the increased frequency doesn't cause performance degradation or rate limiting issues.
pkg/cmd/get/inventory/pvcs.go (1)
20-20: LGTM - Consistent polling interval.pkg/cmd/get/inventory/vms.go (1)
297-297: LGTM - Consistent polling interval.pkg/cmd/get/plan/list.go (1)
251-251: LGTM - Consistent polling interval.pkg/cmd/get/plan/vms.go (1)
56-56: LGTM - Significant polling interval reduction.The reduction from 20s to 5s (4x increase in frequency) is the largest change in this PR. This is beneficial for tracking active migrations where VM states change rapidly.
pkg/cmd/get/inventory/folders.go (1)
20-20: LGTM - Consistent polling interval.pkg/cmd/get/inventory/storage.go (1)
17-25: LGTM!The watch interval reduction is consistent with the broader PR changes and makes the listing more responsive.
pkg/cmd/get/inventory/disks.go (1)
16-24: LGTM!The watch interval change is consistent and correct.
pkg/cmd/get/inventory/resource_pools.go (1)
16-24: LGTM!The watch interval reduction aligns with the PR objectives.
pkg/cmd/get/inventory/providers.go (1)
18-26: LGTM!Consistent watch interval reduction.
pkg/cmd/get/inventory/namespaces.go (1)
17-25: LGTM!The change is correct and consistent.
pkg/cmd/get/inventory/clusters.go (1)
16-24: LGTM!The watch interval change aligns with the PR pattern.
pkg/cmd/get/mapping/list.go (1)
316-320: LGTM!The watch interval reduction from 15s to 5s improves responsiveness and is consistent with similar changes across the codebase.
pkg/cmd/get/inventory/datacenters.go (1)
16-21: Datacenters watch interval now 5s — looks goodThe reduced watch interval is consistent with the PR goal and keeps the control flow unchanged.
pkg/cmd/get/inventory/datastores.go (1)
16-21: Datastores watch interval reduced to 5s — consistent with other commandsOnly the cadence changed; the single-shot and error paths are untouched.
pkg/cmd/get/inventory/datavolumes.go (1)
16-21: DataVolumes watch now polls every 5s — OKThe new interval is consistent with the rest of the inventory watchers; logic remains identical.
pkg/cmd/get/inventory/ec2.go (1)
16-21: EC2 watchers unified to 5s intervalAll EC2 list/watch wrappers now use a 5s polling interval, which is consistent within this file and with the rest of the PR; the underlying listing logic and error handling are unchanged.
Also applies to: 99-104, 185-190, 263-268
pkg/cmd/get/inventory/hosts.go (1)
17-22: Hosts watch interval lowered to 5s — no issuesThe change is limited to the watch cadence; listHostsOnce behavior and validation remain intact.
pkg/cmd/get/inventory/profiles.go (1)
16-21: Disk/NIC profile watchers now 5s — aligned with rest of inventoryBoth ListDiskProfilesWithInsecure and ListNICProfilesWithInsecure now poll every 5s in watch mode, matching the rest of the watch-enabled commands without altering their core logic.
Also applies to: 93-98
Signed-off-by: yaacov <[email protected]>
Summary by CodeRabbit
Performance
Chores
✏️ Tip: You can customize this high-level summary in your review settings.