Skip to content

Conversation

@Syedowais312
Copy link

🚀 Pull Request Title

Improve Test Reporting: Separate Execution Time & Wait Time while keeping Total Runtime


📘 Overview

This PR enhances the accuracy and clarity of test performance metrics reported by Keploy.

Previously, all delays — including actual processing time and artificial waits — were mixed into the single TimeTaken value.
Now, the metrics are broken down into:

🕒 ExecutionTime — Real request processing duration
⏳ WaitTime — Artificial waits (configured delays or internal sleeps)
🧮 TotalRuntime (TimeTaken) — ExecutionTime + WaitTime (backward compatible)

This helps in better debugging, performance profiling, and benchmarking.


🔧 Code Changes

• pkg/models/testrun.go

  • Added ExecutionTime and WaitTime fields to TestReport + TestResult

• pkg/service/replay/replay.go

  • Wrapped SimulateRequest() timing for accurate execution duration
  • Counted sleep/delay in WaitTime
  • Updated summary printer to display breakdown

Example Updated Logs Output:
Execution time: 3.12s
User wait time: 5.00s
Total runtime: 8.12s


🧪 How to Test

Run a test set with a configured delay:
keploy test -c "go run main.go" --delay 5

Expected:
• ExecutionTime ≈ real processing time
• WaitTime ≈ 5 seconds
• Total runtime = sum of both


🎯 Benefits

✔ More accurate timing insights
✔ Easy identification of bottlenecks
✔ Better performance benchmarking
✔ Still fully backward compatible


🔍 Notes for Reviewers

• Validate that coverage and mocks remain unaffected
• Check reports for both CLI logs and stored YAML/JSON
• No breaking changes expected — backward compatibility preserved


📎 Ticket Reference

Closes: (Add issue link if exists)


✔ Checklist

  • [✔ ] Code builds successfully
  • [ ✔] Tested with multiple test sets
  • [ ✔] No regressions in report format
  • [✔ ] Documentation updated if needed

Issue: #3351


Screenshot From 2025-12-10 02-45-49

Signed-off-by: Syedowais312 <syedowais312sf@gmail.com>
@Syedowais312 Syedowais312 force-pushed the feature/modified-execution-time branch from 17959b7 to 2a03208 Compare December 9, 2025 21:25
@Syedowais312
Copy link
Author

Note for reviewers:

The original issue was focused on adding separate ExecutionTime and WaitTime fields.
During implementation, I also extended the test summary CLI output to show the full
timing breakdown (Execution + Wait + Total Runtime), as this provides clear visibility
into the newly added metrics.

Happy to follow the maintainers' guidance here!

Please let me know if any further changes are require

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.

2 participants