New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 BUG: Profiling doesn't work as expected #907
Comments
More info: In chrome://inspect, the button gets enabled after visiting the worker at least once. Dug in a little, and it looks like the prewarm logic isn't working . This code - https://github.com/cloudflare/wrangler2/blob/f2b6cd94b354d44a88298388ccd9ccec710ed093/packages/wrangler/src/create-worker-preview.ts#L169-L171 is always erroring. In the standalone/hotkey tools, the button gets enabled, but doesn't look to ever stop after clicking Stop. |
When calling `wrangler dev`, we make a request to a special URL that "prewarms" the isolate running our Worker so that we can attach devtools etc to it before actually making a request. We'd implemented it wrongly, and because we'd silenced its errors, we weren't catching it. This patch fixes the logic (based on wrangler 1.x's implementation) and enables logging errors when the prewarm request fails. As a result, profiling starts working again as expected. Fixes #907
When calling `wrangler dev`, we make a request to a special URL that "prewarms" the isolate running our Worker so that we can attach devtools etc to it before actually making a request. We'd implemented it wrongly, and because we'd silenced its errors, we weren't catching it. This patch fixes the logic (based on wrangler 1.x's implementation) and enables logging errors when the prewarm request fails. As a result, profiling starts working again as expected. Fixes #907
Reopening this since it looks like the Profiling itself isn't working, it doesn't. Via Discord: Also the cpu profiler doesn't seem to work in devtools. I click record/start, then make a request to my worker (which completes normally), then I stop the profiling. Then it shows that my worker been idle for the whole time. I've tried it a few times now and I'm 100% sure that I'm making a request to my worker (I see console logs in my terminal and devtools) while it's recording. I only see idle in the profiler |
@threepointone to double check whether this even works in the 潭d潭a潭s潭h潭b潭o潭a潭r潭d潭 native devtools. |
I can confirm that profiling is broken at an api/edge level. I verified that profiling doesn't "work" with wrangler 1 as well, so there's nothing to fix here, and we should follow up internally. I'll leave this assigned to me, but marking as blocked for now. |
Related (sort of) to #3 |
@threepointone I've taken a look at this. The spec indicates that the runtime will only send CPU Stats in local fiddle, apparently there were concerns about timing data and Spector. I'll be bridging a discussion of if it is ok to open this up on the edge. |
@petebacondarwin @threepointone I'm asking the Runtime team on Wednesday |
Update, found the bug in the runtime. V8 changed how it returns somethings from the profiler. |
assigning to @Warfields |
@threepointone A fix has been merged to the runtime and is awaiting release. As soon as the next release this bug can be closed CC: @JacobMGEvans As Sunil is out |
The fix has been released |
What version of
Wrangler
are you using?0.0.30
What operating system are you using?
Mac
Describe the Bug
Profiling as described in https://developers.cloudflare.com/workers/learning/profiling-workers/ doesn't work with wrangler v2. The button to start profiling is disabled in devtools. (Whether opened via chrome://inspect, or the standalone tools on hitting D).
The text was updated successfully, but these errors were encountered: