Skip to content

Add CPU time to telemetry#6611

Closed
sebastianbergmann wants to merge 1 commit into
mainfrom
feature/event-telemetry-cpu-time
Closed

Add CPU time to telemetry#6611
sebastianbergmann wants to merge 1 commit into
mainfrom
feature/event-telemetry-cpu-time

Conversation

@sebastianbergmann
Copy link
Copy Markdown
Owner

Every emitted event now carries CPU time information (user, system, and total) alongside wall-clock time, memory usage, and garbage collector status. This makes it possible to distinguish CPU-bound from I/O-bound test work, wall-clock time alone conflates the two.

The Telemetry value object that is part of each Event emitted now exposes user, system, and total CPU time, plus deltas since the test run started and since the previous event (mirroring how duration and memory usage are already exposed).

The <phpunit:resourceUsage> element of Open Test Reporting XML gains three new attributes (userCpuTime, systemCpuTime, cpuTime) for both test and test-suite entries. The schema is updated accordingly.

JUnit XML and TeamCity output formats as well as other outputs are unchanged.

@sebastianbergmann sebastianbergmann self-assigned this May 12, 2026
@sebastianbergmann sebastianbergmann added type/enhancement A new idea that should be implemented feature/test-runner CLI test runner feature/events Issues related to PHPUnit's event system feature/logging/otr Issues related to logging test results in Open Test Reporting XML format labels May 12, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

API Surface Changes

If any of the additions below are not intended as public API, mark them with @internal in the docblock.

New API Surface

Classes

Methods

@sebastianbergmann sebastianbergmann force-pushed the feature/event-telemetry-cpu-time branch from 3aa3ca8 to b49f697 Compare May 12, 2026 14:40
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.86%. Comparing base (53effd8) to head (cf4af52).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6611      +/-   ##
============================================
+ Coverage     96.84%   96.86%   +0.01%     
- Complexity     8476     8510      +34     
============================================
  Files           861      863       +2     
  Lines         26126    26283     +157     
============================================
+ Hits          25301    25458     +157     
  Misses          825      825              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sebastianbergmann sebastianbergmann force-pushed the feature/event-telemetry-cpu-time branch from b49f697 to cf4af52 Compare May 12, 2026 15:22
@sebastianbergmann sebastianbergmann marked this pull request as ready for review May 12, 2026 15:49
@sebastianbergmann sebastianbergmann deleted the feature/event-telemetry-cpu-time branch May 12, 2026 15:52
@sebastianbergmann sebastianbergmann added this to the PHPUnit 13.2 milestone May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/events Issues related to PHPUnit's event system feature/logging/otr Issues related to logging test results in Open Test Reporting XML format feature/test-runner CLI test runner type/enhancement A new idea that should be implemented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant