1- # ` cross-thread-stack-trace `
1+ # ` @sentry-internal/node-native-stacktrace `
22
33Native Node module to capture stack traces from all registered threads.
44
@@ -8,15 +8,15 @@ thread, even if the event loops are blocked.
88In the main or worker threads:
99
1010``` ts
11- const { registerThread } = require (" cross-thread-stack-trace " );
11+ const { registerThread } = require (" @sentry-internal/node-native-stacktrace " );
1212
1313registerThread ();
1414```
1515
1616Watchdog thread:
1717
1818``` ts
19- const { captureStackTrace } = require (" cross-thread-stack-trace " );
19+ const { captureStackTrace } = require (" @sentry-internal/node-native-stacktrace " );
2020
2121const stacks = captureStackTrace ();
2222console .log (stacks );
@@ -87,28 +87,29 @@ In the main or worker threads if you call `registerThread()` regularly, times
8787are recorded.
8888
8989``` ts
90- const { registerThread } = require (" cross-thread-stack-trace " );
90+ const { registerThread } = require (" @sentry-internal/node-native-stacktrace " );
9191
9292setInterval (() => {
9393 registerThread ();
9494}, 200 );
9595```
9696
97- In the watchdog thread you can call ` getThreadLastSeen ()` to get how long it's
97+ In the watchdog thread you can call ` getThreadsLastSeen ()` to get how long it's
9898been in milliseconds since each thread registered.
9999
100100If any thread has exceeded a threshold, you can call ` captureStackTrace() ` to
101101get the stack traces for all threads.
102102
103103``` ts
104- const { captureStackTrace, getThreadLastSeen } = require (
105- " cross-thread-stack-trace" ,
106- );
104+ const {
105+ captureStackTrace,
106+ getThreadsLastSeen,
107+ } = require (" @sentry-internal/node-native-stacktrace" );
107108
108109const THRESHOLD = 1000 ; // 1 second
109110
110111setInterval (() => {
111- for (const [thread, time] in Object .entries (getThreadLastSeen ())) {
112+ for (const [thread, time] in Object .entries (getThreadsLastSeen ())) {
112113 if (time > THRESHOLD ) {
113114 const stacks = captureStackTrace ();
114115 const blockedThread = stacks [thread ];
0 commit comments