SpectoLabs / hoverfly

Lightweight service virtualization/ API simulation / API mocking tool for developers and testers
https://hoverfly.io
Apache License 2.0
2.36k stars 208 forks source link

Capture timing of requests #1153

Closed nmck257 closed 1 month ago

nmck257 commented 1 month ago

(I'm new to Hoverfly)

Is your feature request related to a problem? Please describe. I think Hoverfly could be useful not just for unit testing, but performance testing. In (some forms of) performance testing, I would like to stub out my application's connections to downstream webservices and return fixed responses, but with realistic (data-driven) delay.

Describe the solution you'd like Could Capture mode be enhanced to grab not only request/response, but also the time taken for the roundtrip? This data could (minimally) be read by the developer to better-inform "hardcoded" delays, or a step further, could feed directly into Simulate mode.

Describe alternatives you've considered Manually researching and configuring delays for requests.

tommysitu commented 1 month ago

As a starting point, we can record the latency as fixed delay in capture mode. It seems easy to implement.

kapishmalik commented 1 month ago

@tommysitu can I pick this up?

tommysitu commented 1 month ago

@tommysitu can I pick this up?

@kapishmalik of course if you have time. Thank you!

kapishmalik commented 1 month ago

Sure, I will manage and start working on the same.

kapishmalik commented 1 month ago

Raised PR - https://github.com/SpectoLabs/hoverfly/pull/1154

nmck257 commented 1 month ago

Very cool to see the quick turnaround on this idea!