Skip to content

Commit 1bb6b30

Browse files
Adds suggestions for more prod-like debugging in DevTools (#18428)
Adds suggestions for more prod-like debugging in DevTools Co-authored-by: ToriLindsay <[email protected]>
1 parent 6d4413d commit 1bb6b30

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/content/docs/workers/observability/dev-tools/cpu-usage.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Measuring execution time of specific functions in production can be difficult be
1414
[only increment timers on I/O](/workers/reference/security-model/#step-1-disallow-timers-and-multi-threading)
1515
for security purposes. However, measuring CPU execution times is possible in local development with DevTools.
1616

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

1924
To generate a CPU profile:

src/content/docs/workers/observability/dev-tools/memory-usage.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ You can profile memory usage with snapshots in DevTools. Memory snapshots let yo
1313
memory usage, see how much memory is allocated to different data types, and get details on specific
1414
objects in memory.
1515

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

1823
To generate a memory snapshot:

0 commit comments

Comments
 (0)