spatie / ray

Debug with Ray to fix problems faster
https://myray.app
MIT License
574 stars 102 forks source link

ray()->measure is useless as it counts the trip time to ray into its execution time #641

Closed genesiscz closed 2 years ago

genesiscz commented 2 years ago

Describe the bug So when you do ray()->measure("ha"); ray()->measure("ha"); you get this

image

which pretty much loses all the sense to use since it measures the trip time to report the timer to ray (I guess?).

Additionally, would it be a possibility to somehow do the reporting asynchronously/not slow down the application execution due to the trip time of the payloads?

The solution to the first problem is avoidable by passing the closure, but only if you measure one thing at the time. Wouldn't it make more sense to do the requests to ray differently or at least measure the time of the request it is sent to ray & calculate the difference?

Versions Ray version (you can see this in "About Ray"): any

PHP version: 8.0 Laravel version (if applicable): 8.XX