Repository navigation
[PoC] Surface per-script execution time on the script trigger result - #1573
Draft
saialekhya-001 wants to merge 1 commit into
Draft
saialekhya-001 wants to merge 1 commit into
saialekhya-001 wants to merge 1 commit into
Conversation
…sult Measures how long each prerequest/test script takes and exposes it on the `script` trigger's `result` so downstream consumers (e.g. performance test runs) can report script cost alongside the HTTP timing phases. - Prefers the sandbox's own in-sandbox measure (`result.return.executionTime`, added in a companion postman-sandbox change) which excludes host<->sandbox bridge/IPC and host-side queue wait. - Falls back to a host wall-clock measure around `host.execute()` when the sandbox does not provide one, so the change is safe with an unpatched sandbox. - Also attaches `result.executionTimeWall` (the wall-clock value) for PoC comparison; to be dropped before productionization. PoC for visualizing response-time breakdown + script execution time per request execution in performance runs. Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
❌ Your project check has failed because the head coverage (34.14%) is below the target coverage (35.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #1573 +/- ##
===========================================
- Coverage 77.72% 77.71% -0.02%
===========================================
Files 51 51
Lines 4369 4376 +7
Branches 1234 1238 +4
===========================================
+ Hits 3396 3401 +5
Misses 730 730
- Partials 243 245 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / Why
PoC to enable showing a per-request-execution time breakdown in performance runs — the same HTTP phase waterfall the single-request view shows (Prepare / Socket Init / DNS / TCP / SSL / TTFB / Download / Process) plus prerequest/test script execution time. Runtime already emits the HTTP timing offsets; it did not surface how long user scripts take. This adds that.
Change
lib/runner/extensions/event.command.js— aroundhost.execute()in the script execution path:result.executionTime(ms) on the script result before thescripttrigger fires.result.return.executionTime(added in companion [postman-sandbox PoC PR]) — it excludes host↔sandbox bridge/IPC and host-side queue wait, so it's a tighter, steadier number.host.execute()when the sandbox doesn't provide one → safe with an unpatched sandbox.result.executionTimeWallfor PoC comparison (in-sandbox vs wall). To be removed before productionization.Measured (2 VUs, local)
In-sandbox is consistently lower and less jittery → the right source.
Companion changes
execution.return.executionTime(in-sandbox duration).result.executionTime+ the HTTP phase breakdown per execution.Status
Draft / PoC. Not productionized: wall-clock comparison field is temporary; based on recent
develop.Generated with Claude Code