Skip to content

feat: report refresh phase progress telemetry (Fixes #479) - #494

Merged
Karthik Nadig (karthiknadig) merged 1 commit into
mainfrom
feature/issue-479
Aug 5, 2026
Merged

feat: report refresh phase progress telemetry (Fixes #479)#494
Karthik Nadig (karthiknadig) merged 1 commit into
mainfrom
feature/issue-479

Conversation

@karthiknadig

Copy link
Copy Markdown
Member

Summary

  • expose a refreshId in refresh results for operation correlation
  • emit started/completed telemetry for locators, PATH, global virtualenvs, and workspaces
  • include per-locator start/completion timing without paths or environment data
  • preserve one operation ID for concurrent identical refresh requests
  • document and test the JSON-RPC telemetry payload

Validation

  • cargo test -p pet-core
  • cargo test -p pet-reporter refresh_progress_serializes_privacy_safe_fields
  • cargo test -p pet --test jsonrpc_server_test
  • cargo test -p pet refresh_progress_reports_phases_and_locator_timing
  • .\scripts\rust-precommit.ps1

Fixes #479

Expose a refresh operation ID in results and emit privacy-safe phase and per-locator timing notifications for timeout diagnosis.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Performance Report (Linux) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 1ms 1ms 0ms 1ms N/A%
Full Refresh 50ms 624ms 50ms 0ms 0%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Performance Report (macOS)

Metric PR (P50) PR (P95) Baseline (P50) Delta
Server Startup 89ms 16868ms 119ms -30ms
Full Refresh 227ms 30352ms 282ms -55ms

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Performance Report (Windows) ➖

Metric PR (P50) PR (P95) Baseline (P50) Delta Change
Server Startup 8ms 12ms 9ms -1ms -11.1%
Full Refresh 154ms 1512ms 137ms 17ms 12.4%

Results based on 10 iterations. P50 = median, P95 = 95th percentile.


Legend
  • 🚀 Significant speedup (>100ms faster)
  • ✅ Faster than baseline
  • ➖ No significant change
  • 🔺 Slower than baseline (>100ms)
  • ⚠️ Significant slowdown (>500ms)

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Test Coverage Report (Linux)

Metric Value
Current Coverage 80.5%
Base Branch Coverage 80.4%
Delta .1% ✅

Coverage increased! Great work!

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Test Coverage Report (Windows)

Metric Value
Current Coverage 77.4%
Base Branch Coverage 77.19%
Delta 0.21% ✅

Coverage increased! Great work!

Copilot AI 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.

Pull request overview

This PR adds privacy-safe refresh progress telemetry to PET’s JSON-RPC refresh flow so timeouts can be diagnosed by identifying which major phase (and which locator within the locator phase) was running when a refresh was interrupted. It introduces a refreshId for correlating refresh results and progress events, and updates documentation and tests to validate payload shape and privacy constraints.

Changes:

  • Add refreshId to the refresh result for correlation across refresh responses and progress telemetry.
  • Emit RefreshProgress telemetry (started/completed) for the major refresh phases and per-locator timing within the locators phase.
  • Document and test the JSON-RPC telemetry payload, including field casing and ensuring no path/environment data is included.
Show a summary per file
File Description
docs/JSONRPC.md Documents refreshId in refresh results and the RefreshProgress telemetry payload shape and privacy guarantees.
crates/pet/src/jsonrpc.rs Generates refreshId, includes it in refresh results, and passes it into refresh discovery for progress reporting.
crates/pet/src/find.rs Implements RefreshProgress emission for phase start/complete and per-locator start/complete with elapsed timings.
crates/pet-core/src/telemetry/mod.rs Adds the RefreshProgress telemetry event variant and event name mapping.
crates/pet-core/src/telemetry/refresh_progress.rs Defines the telemetry model (RefreshProgress, phase/status enums) with camelCase serialization.
crates/pet-reporter/src/jsonrpc.rs Adds serialization test ensuring RefreshProgress payload is camelCase and privacy-safe.
crates/pet/tests/jsonrpc_client.rs Extends test client to deserialize refreshId and to filter/wait for telemetry events by name.
crates/pet/tests/jsonrpc_server_test.rs Updates JSON-RPC integration tests to validate RefreshPerformance and RefreshProgress counts and refreshId correlation + privacy checks.
crates/pet/src/lib.rs Updates find_and_report_envs call sites for the new optional refresh_id parameter.
crates/pet/tests/ci_test.rs Updates find_and_report_envs call sites for the new optional refresh_id parameter.
crates/pet/tests/ci_poetry.rs Updates find_and_report_envs call sites for the new optional refresh_id parameter.
crates/pet/tests/ci_jupyter_container.rs Updates find_and_report_envs call sites for the new optional refresh_id parameter.
crates/pet/tests/ci_homebrew_container.rs Updates find_and_report_envs call sites for the new optional refresh_id parameter.

Review details

  • Files reviewed: 13/13 changed files
  • Comments generated: 0
  • Review effort level: Low

@karthiknadig
Karthik Nadig (karthiknadig) merged commit 1b74614 into main Aug 5, 2026
38 checks passed
@karthiknadig
Karthik Nadig (karthiknadig) deleted the feature/issue-479 branch August 5, 2026 22:49
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.

Add minimal PET refresh progress telemetry for timeout diagnosis

3 participants