Skip to content

Commit

Permalink
Adds suggestions for more prod-like debugging in DevTools (#18428)
Browse files Browse the repository at this point in the history
Adds suggestions for more prod-like debugging in DevTools

Co-authored-by: ToriLindsay <[email protected]>
  • Loading branch information
mikenomitch and ToriLindsay authored Jan 6, 2025
1 parent 6d4413d commit 1bb6b30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Measuring execution time of specific functions in production can be difficult be
[only increment timers on I/O](/workers/reference/security-model/#step-1-disallow-timers-and-multi-threading)
for security purposes. However, measuring CPU execution times is possible in local development with DevTools.

When using DevTools to monitor CPU usage, it may be difficult to replicate specific behavior you are
seeing in production. To mimic production behavior, make sure the requests you send to the local Worker
are similar to requests in production. This might mean sending a large volume of requests, making requests
to specific routes, or using production-like data with the [--remote flag](/workers/testing/local-development/#develop-using-remote-resources-and-bindings).

## Taking a profile

To generate a CPU profile:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ You can profile memory usage with snapshots in DevTools. Memory snapshots let yo
memory usage, see how much memory is allocated to different data types, and get details on specific
objects in memory.

When using DevTools to profile memory, it may be difficult to replicate specific behavior you are
seeing in production. To mimic production behavior, make sure the requests you send to the local Worker
are similar to requests in production. This might mean sending a large volume of requests, making requests
to specific routes, or using production-like data with the [--remote flag](/workers/testing/local-development/#develop-using-remote-resources-and-bindings).

## Taking a snapshot

To generate a memory snapshot:
Expand Down

0 comments on commit 1bb6b30

Please sign in to comment.