USHIFT-6799: C2CC: Latency measurement between clusters#6794
Conversation
The probe pod will populate latency statistics from a rolling window of probe samples. Using metav1.Duration fields (serialized as Go duration strings like "1.234ms") avoids controller-gen's restriction on float types while keeping values human-readable.
Circular buffer of 20 samples that computes avg, min, max, last, and stddev as time.Duration values.
Each successful HTTP probe now measures round-trip time. The RTT is added to a per-remote-cluster latencyWindow (circular buffer of 20 samples), and the computed stats are written to status.latency on every status update. The window resets when a probe is restarted (e.g. on spec change). Latency stats are preserved across failed probes to avoid losing data during transient failures.
|
Skipping CI for Draft Pull Request. |
|
@pmtk: This pull request references USHIFT-6799 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThis PR adds rolling-window latency collection and stats for RemoteCluster probes: a ring buffer computes avg/min/max/last/stddev, probe manager records RTTs and sets status.Latency, CRD and Go types expose the stats, and Robot tests verify end-to-end reporting. ChangesLatency Tracking Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error, 1 warning)
✅ Passed checks (13 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pmtk The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/suites/c2cc/probe.robot`:
- Around line 88-101: The test "Latency Stats Are Reasonable" currently only
checks presence via Should Not Be Empty for fields retrieved by Get Latency
Field; either rename the test to something like "Latency Stats Present" to
reflect presence-only checks, or add numeric/bounds validation: for each ${avg},
${min}, ${max}, ${last}, ${stddev} convert to numbers (e.g., using Convert To
Number or your helper) and assert ${min} >= 0, ${stddev} >= 0, ${min} <= ${avg}
<= ${max}, ${last} within [${min}, ${max}], and optionally enforce an upper
bound on ${max} (e.g., <200 ms) to reflect "reasonable" for local-network
probes; update the test body accordingly where Get Latency Field and Should Not
Be Empty are used.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 282796d3-2f96-4f81-b68f-0c9a5e284a70
⛔ Files ignored due to path filters (1)
pkg/apis/microshift/v1alpha1/zz_generated.deepcopy.gois excluded by!**/zz_generated*
📒 Files selected for processing (6)
assets/crd/microshift.io_remoteclusters.yamlpkg/apis/microshift/v1alpha1/types.gopkg/controllers/c2cc/latency.gopkg/controllers/c2cc/latency_test.gopkg/controllers/c2cc/probe.gotest/suites/c2cc/probe.robot
Verifies that RemoteCluster CRs are populated with latency stats (avg, min, max, last, stddev) after probes have run, and that all fields contain non-empty duration values.
|
/test e2e-aws-tests-bootc-arm-el9 e2e-aws-tests-bootc-el10 |
|
/test e2e-aws-tests |
|
@pmtk: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
it looks to me from QE POV |
Summary by CodeRabbit
New Features
Improvements
Tests