Skip to content

Add pagination metrics for known tests fetch#292

Draft
calvinbayer wants to merge 1 commit into
mainfrom
add-known-tests-pagination-metrics
Draft

Add pagination metrics for known tests fetch#292
calvinbayer wants to merge 1 commit into
mainfrom
add-known-tests-pagination-metrics

Conversation

@calvinbayer

Copy link
Copy Markdown

What does this PR do?

Adds three new distribution metrics to track known tests (Early Flake Detection) pagination behavior:

  • civisibility.known_tests.pages_fetched - Number of pages fetched during pagination
  • civisibility.known_tests.total_fetch_ms - Wall-clock time from first to last page request
  • civisibility.known_tests.total_request_ms - Sum of individual per-page request durations

Motivation

Currently, only per-request timing is tracked. These new metrics provide observability into:

  • How often pagination occurs (single vs multi-page responses)
  • Backend pagination performance (total wall-clock time)
  • Network overhead vs local processing time (total_fetch_ms vs total_request_ms)

Implementation Details

  • Extended KnownTestsResult struct with three metric fields
  • Added metric definitions to TelemetryMetrics
  • Updated fetchKnownTests to track timing and emit metrics on success
  • Metrics are emitted only on successful completion after all pages are fetched

Testing

  • Code compiles and follows Swift patterns
  • Requires Swift 6.2 + Xcode for full test execution
  • CI will run full test suite

Checklist

  • Code complete and follows patterns
  • Backward compatible (no breaking changes)
  • Follows existing telemetry patterns
  • CI tests (requires Swift 6.2 environment)

@calvinbayer calvinbayer force-pushed the add-known-tests-pagination-metrics branch from bbc2c00 to f3b3530 Compare July 13, 2026 11:46
Add three new distribution metrics to track known tests pagination:
- civisibility.known_tests.pages_fetched - number of pages fetched
- civisibility.known_tests.total_fetch_ms - wall-clock time for entire fetch
- civisibility.known_tests.total_request_ms - sum of per-page request times

Metrics are emitted only on successful completion of pagination.

Changes:
- Extended KnownTestsResult with metric fields
- Added metric definitions to TelemetryMetrics
- Updated fetchKnownTests to track timing and emit metrics

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@calvinbayer calvinbayer force-pushed the add-known-tests-pagination-metrics branch from f3b3530 to 6b3bb0a Compare July 13, 2026 16:01
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