MCPcopy Index your code
hub / github.com/callstack/agent-device / withDiagnosticsScope

Function withDiagnosticsScope

src/utils/diagnostics.ts:52–64  ·  view source on GitHub ↗
(
  options: DiagnosticsScopeOptions,
  fn: () => Promise<T> | T,
)

Source from the content-addressed store, hash-verified

50}
51
52export async function withDiagnosticsScope<T>(
53 options: DiagnosticsScopeOptions,
54 fn: () => Promise<T> | T,
55): Promise<T> {
56 const scope: DiagnosticsScope = {
57 ...options,
58 diagnosticId: createDiagnosticId(),
59 events: [],
60 liveWrittenEventCount: 0,
61 phaseCounts: new Map(),
62 };
63 return await diagnosticsStorage.run(scope, fn);
64}
65
66export function updateDiagnosticsScope(options: DiagnosticsScopeOptions): void {
67 const scope = diagnosticsStorage.getStore();

Callers 13

runCliFunction · 0.90
retry.test.tsFile · 0.90
exec.test.tsFile · 0.90
handleRequestFunction · 0.90
emitFatalDiagnosticFunction · 0.90
index.test.tsFile · 0.90
captureDiagnosticsFunction · 0.90
index.test.tsFile · 0.90
captureDiagnosticsFunction · 0.90

Calls 1

createDiagnosticIdFunction · 0.85

Tested by 3

captureDiagnosticsFunction · 0.72
captureDiagnosticsFunction · 0.72