react-native-nitro-tracing 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/LICENSE +21 -0
- package/NitroTracing.podspec +32 -0
- package/README.md +75 -0
- package/android/CMakeLists.txt +49 -0
- package/android/build.gradle +133 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/proguard-rules.pro +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +47 -0
- package/android/src/main/java/com/margelo/nitro/nitrotracing/HermesSamplingGuard.kt +43 -0
- package/android/src/main/java/com/margelo/nitro/nitrotracing/NitroTracingFrameSource.kt +36 -0
- package/android/src/main/java/com/margelo/nitro/nitrotracing/NitroTracingPackage.kt +31 -0
- package/client.ts +15 -0
- package/cpp/HermesSampling.cpp +26 -0
- package/cpp/HermesSampling.hpp +10 -0
- package/cpp/HybridRecording.cpp +66 -0
- package/cpp/HybridRecording.hpp +30 -0
- package/cpp/HybridTraceSpan.cpp +10 -0
- package/cpp/HybridTraceSpan.hpp +17 -0
- package/cpp/HybridTracing.cpp +10 -0
- package/cpp/HybridTracing.hpp +10 -0
- package/cpp/NativeConversions.cpp +77 -0
- package/cpp/NativeConversions.hpp +15 -0
- package/cpp/core/NativeSampler.cpp +152 -0
- package/cpp/core/NativeSampler.hpp +56 -0
- package/cpp/core/Recorder.cpp +218 -0
- package/cpp/core/Recorder.hpp +60 -0
- package/cpp/core/Retention.cpp +26 -0
- package/cpp/core/Retention.hpp +7 -0
- package/cpp/core/TraceJson.cpp +214 -0
- package/cpp/core/TraceJson.hpp +7 -0
- package/cpp/core/TraceTypes.hpp +62 -0
- package/expo.ts +2 -0
- package/ios/NitroTracingFrameSource.mm +35 -0
- package/lib/commonjs/client.cjs +767 -0
- package/lib/commonjs/client.cjs.map +7 -0
- package/lib/commonjs/expo.cjs +88 -0
- package/lib/commonjs/expo.cjs.map +7 -0
- package/lib/commonjs/index.cjs +28 -0
- package/lib/commonjs/index.cjs.map +7 -0
- package/lib/commonjs/performance.cjs +112 -0
- package/lib/commonjs/performance.cjs.map +7 -0
- package/lib/commonjs/plugins.cjs +477 -0
- package/lib/commonjs/plugins.cjs.map +7 -0
- package/lib/commonjs/react.cjs +3833 -0
- package/lib/commonjs/react.cjs.map +7 -0
- package/lib/commonjs/release-profiler.cjs +142 -0
- package/lib/commonjs/release-profiler.cjs.map +7 -0
- package/lib/commonjs/sentry.cjs +188 -0
- package/lib/commonjs/sentry.cjs.map +7 -0
- package/lib/module/client.mjs +768 -0
- package/lib/module/client.mjs.map +7 -0
- package/lib/module/expo.mjs +62 -0
- package/lib/module/expo.mjs.map +7 -0
- package/lib/module/index.mjs +7 -0
- package/lib/module/index.mjs.map +7 -0
- package/lib/module/performance.mjs +89 -0
- package/lib/module/performance.mjs.map +7 -0
- package/lib/module/plugins.mjs +461 -0
- package/lib/module/plugins.mjs.map +7 -0
- package/lib/module/react.mjs +3851 -0
- package/lib/module/react.mjs.map +7 -0
- package/lib/module/release-profiler.mjs +137 -0
- package/lib/module/release-profiler.mjs.map +7 -0
- package/lib/module/sentry.mjs +165 -0
- package/lib/module/sentry.mjs.map +7 -0
- package/lib/typescript/client.d.ts +4 -0
- package/lib/typescript/expo.d.ts +2 -0
- package/lib/typescript/performance.d.ts +2 -0
- package/lib/typescript/plugins.d.ts +12 -0
- package/lib/typescript/react.d.ts +5 -0
- package/lib/typescript/release-profiler.d.ts +2 -0
- package/lib/typescript/sentry.d.ts +2 -0
- package/lib/typescript/src/client/TracingSink.d.ts +10 -0
- package/lib/typescript/src/client/createTraceClient.d.ts +82 -0
- package/lib/typescript/src/client/playground.d.ts +12 -0
- package/lib/typescript/src/expo/ExpoAdapter.d.ts +15 -0
- package/lib/typescript/src/expo/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/plugins/TracePlugin.d.ts +22 -0
- package/lib/typescript/src/plugins/errors.d.ts +15 -0
- package/lib/typescript/src/plugins/nativeMetrics.d.ts +13 -0
- package/lib/typescript/src/plugins/navigation.d.ts +29 -0
- package/lib/typescript/src/plugins/network.d.ts +23 -0
- package/lib/typescript/src/plugins/orderSpans.d.ts +3 -0
- package/lib/typescript/src/plugins/performance.d.ts +13 -0
- package/lib/typescript/src/plugins/releaseProfiler.d.ts +25 -0
- package/lib/typescript/src/plugins/runtimeMetrics.d.ts +17 -0
- package/lib/typescript/src/plugins/sentry.d.ts +15 -0
- package/lib/typescript/src/plugins/startPlugins.d.ts +4 -0
- package/lib/typescript/src/react/DetailView.d.ts +11 -0
- package/lib/typescript/src/react/ExplorerFilters.d.ts +9 -0
- package/lib/typescript/src/react/ExplorerView.d.ts +9 -0
- package/lib/typescript/src/react/InspectorControls.d.ts +229 -0
- package/lib/typescript/src/react/InspectorHeader.d.ts +8 -0
- package/lib/typescript/src/react/InspectorSheet.d.ts +16 -0
- package/lib/typescript/src/react/MetricsView.d.ts +7 -0
- package/lib/typescript/src/react/SummaryView.d.ts +11 -0
- package/lib/typescript/src/react/TimelineView.d.ts +8 -0
- package/lib/typescript/src/react/TraceInspector.d.ts +11 -0
- package/lib/typescript/src/react/TraceOverlay.d.ts +17 -0
- package/lib/typescript/src/react/explorerModel.d.ts +38 -0
- package/lib/typescript/src/react/labels.d.ts +203 -0
- package/lib/typescript/src/react/native.d.ts +42 -0
- package/lib/typescript/src/react/readSnapshot.d.ts +4 -0
- package/lib/typescript/src/react/store.d.ts +9 -0
- package/lib/typescript/src/react/topics.d.ts +80 -0
- package/lib/typescript/src/react/useAppReadyMetric.d.ts +3 -0
- package/lib/typescript/src/react/useLiveRecording.d.ts +4 -0
- package/lib/typescript/src/react/useTraceViewer.d.ts +140 -0
- package/lib/typescript/src/react/viewerModel.d.ts +59 -0
- package/lib/typescript/src/specs/Recording.nitro.d.ts +31 -0
- package/lib/typescript/src/specs/TraceSpan.nitro.d.ts +14 -0
- package/lib/typescript/src/specs/Tracing.nitro.d.ts +17 -0
- package/lib/typescript/src/types/CompletedSpanOptions.d.ts +15 -0
- package/lib/typescript/src/types/EventContext.d.ts +8 -0
- package/lib/typescript/src/types/MarkEvent.d.ts +4 -0
- package/lib/typescript/src/types/MarkOptions.d.ts +6 -0
- package/lib/typescript/src/types/MetricEvent.d.ts +8 -0
- package/lib/typescript/src/types/MetricOptions.d.ts +10 -0
- package/lib/typescript/src/types/NativeSamplingOptions.d.ts +7 -0
- package/lib/typescript/src/types/ReadOptions.d.ts +7 -0
- package/lib/typescript/src/types/RecordingOptions.d.ts +11 -0
- package/lib/typescript/src/types/RecordingStats.d.ts +25 -0
- package/lib/typescript/src/types/SpanEvent.d.ts +13 -0
- package/lib/typescript/src/types/SpanOptions.d.ts +6 -0
- package/lib/typescript/src/types/SpanOutcome.d.ts +2 -0
- package/lib/typescript/src/types/TraceAttribute.d.ts +7 -0
- package/lib/typescript/src/types/TraceAttributes.d.ts +3 -0
- package/lib/typescript/src/types/TraceContext.d.ts +10 -0
- package/lib/typescript/src/types/TracePage.d.ts +18 -0
- package/lib/typescript/src/types.d.ts +17 -0
- package/nitro.json +20 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/NitroTracing+autolinking.cmake +83 -0
- package/nitrogen/generated/android/NitroTracing+autolinking.gradle +27 -0
- package/nitrogen/generated/android/NitroTracingOnLoad.cpp +49 -0
- package/nitrogen/generated/android/NitroTracingOnLoad.hpp +34 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/nitrotracing/NitroTracingOnLoad.kt +35 -0
- package/nitrogen/generated/ios/NitroTracing+autolinking.rb +62 -0
- package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Bridge.cpp +17 -0
- package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Bridge.hpp +27 -0
- package/nitrogen/generated/ios/NitroTracing-Swift-Cxx-Umbrella.hpp +38 -0
- package/nitrogen/generated/ios/NitroTracingAutolinking.mm +35 -0
- package/nitrogen/generated/ios/NitroTracingAutolinking.swift +16 -0
- package/nitrogen/generated/shared/c++/CompletedSpanOptions.hpp +122 -0
- package/nitrogen/generated/shared/c++/HybridRecordingSpec.cpp +31 -0
- package/nitrogen/generated/shared/c++/HybridRecordingSpec.hpp +100 -0
- package/nitrogen/generated/shared/c++/HybridTraceSpanSpec.cpp +23 -0
- package/nitrogen/generated/shared/c++/HybridTraceSpanSpec.hpp +65 -0
- package/nitrogen/generated/shared/c++/HybridTracingSpec.cpp +22 -0
- package/nitrogen/generated/shared/c++/HybridTracingSpec.hpp +68 -0
- package/nitrogen/generated/shared/c++/MarkEvent.hpp +102 -0
- package/nitrogen/generated/shared/c++/MarkOptions.hpp +99 -0
- package/nitrogen/generated/shared/c++/MetricEvent.hpp +110 -0
- package/nitrogen/generated/shared/c++/MetricOptions.hpp +107 -0
- package/nitrogen/generated/shared/c++/NativeSamplingOptions.hpp +87 -0
- package/nitrogen/generated/shared/c++/ReadOptions.hpp +87 -0
- package/nitrogen/generated/shared/c++/RecordingOptions.hpp +95 -0
- package/nitrogen/generated/shared/c++/RecordingStats.hpp +123 -0
- package/nitrogen/generated/shared/c++/SpanEvent.hpp +121 -0
- package/nitrogen/generated/shared/c++/SpanOptions.hpp +99 -0
- package/nitrogen/generated/shared/c++/SpanOutcome.hpp +84 -0
- package/nitrogen/generated/shared/c++/TraceAttribute.hpp +87 -0
- package/nitrogen/generated/shared/c++/TracePage.hpp +111 -0
- package/package.json +236 -0
- package/performance.ts +2 -0
- package/plugins.ts +24 -0
- package/react-native.config.js +16 -0
- package/react.ts +10 -0
- package/release-profiler.ts +6 -0
- package/sentry.ts +2 -0
- package/src/client/TracingSink.ts +25 -0
- package/src/client/createTraceClient.ts +439 -0
- package/src/client/playground.ts +143 -0
- package/src/expo/ExpoAdapter.ts +71 -0
- package/src/expo/index.ts +2 -0
- package/src/index.ts +8 -0
- package/src/plugins/TracePlugin.ts +22 -0
- package/src/plugins/errors.ts +69 -0
- package/src/plugins/nativeMetrics.ts +26 -0
- package/src/plugins/navigation.ts +111 -0
- package/src/plugins/network.ts +178 -0
- package/src/plugins/orderSpans.ts +22 -0
- package/src/plugins/performance.ts +120 -0
- package/src/plugins/releaseProfiler.ts +123 -0
- package/src/plugins/runtimeMetrics.ts +131 -0
- package/src/plugins/sentry.ts +176 -0
- package/src/plugins/startPlugins.ts +58 -0
- package/src/react/DetailView.tsx +514 -0
- package/src/react/ExplorerFilters.tsx +151 -0
- package/src/react/ExplorerView.tsx +243 -0
- package/src/react/InspectorControls.tsx +651 -0
- package/src/react/InspectorHeader.tsx +171 -0
- package/src/react/InspectorSheet.tsx +89 -0
- package/src/react/MetricsView.tsx +182 -0
- package/src/react/SummaryView.tsx +121 -0
- package/src/react/TimelineView.tsx +87 -0
- package/src/react/TraceInspector.tsx +196 -0
- package/src/react/TraceOverlay.tsx +585 -0
- package/src/react/explorerModel.ts +285 -0
- package/src/react/labels.ts +234 -0
- package/src/react/native.tsx +159 -0
- package/src/react/readSnapshot.ts +58 -0
- package/src/react/store.ts +31 -0
- package/src/react/topics.ts +427 -0
- package/src/react/useAppReadyMetric.ts +10 -0
- package/src/react/useLiveRecording.ts +43 -0
- package/src/react/useTraceViewer.ts +333 -0
- package/src/react/viewerModel.ts +172 -0
- package/src/specs/Recording.nitro.ts +40 -0
- package/src/specs/TraceSpan.nitro.ts +14 -0
- package/src/specs/Tracing.nitro.ts +14 -0
- package/src/types/CompletedSpanOptions.ts +15 -0
- package/src/types/EventContext.ts +8 -0
- package/src/types/MarkEvent.ts +3 -0
- package/src/types/MarkOptions.ts +6 -0
- package/src/types/MetricEvent.ts +8 -0
- package/src/types/MetricOptions.ts +10 -0
- package/src/types/NativeSamplingOptions.ts +7 -0
- package/src/types/ReadOptions.ts +7 -0
- package/src/types/RecordingOptions.ts +11 -0
- package/src/types/RecordingStats.ts +25 -0
- package/src/types/SpanEvent.ts +13 -0
- package/src/types/SpanOptions.ts +6 -0
- package/src/types/SpanOutcome.ts +2 -0
- package/src/types/TraceAttribute.ts +7 -0
- package/src/types/TraceAttributes.ts +4 -0
- package/src/types/TraceContext.ts +10 -0
- package/src/types/TracePage.ts +18 -0
- package/src/types.ts +17 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
export declare const defaultLabels: {
|
|
2
|
+
readonly applyFilters: "Apply";
|
|
3
|
+
readonly title: "Performance";
|
|
4
|
+
readonly searchMatch: "Search match";
|
|
5
|
+
readonly explore: "Explore";
|
|
6
|
+
readonly profiles: "Profiles";
|
|
7
|
+
readonly spans: "Spans";
|
|
8
|
+
readonly events: "events";
|
|
9
|
+
readonly actions: "Actions";
|
|
10
|
+
readonly tools: "Tools";
|
|
11
|
+
readonly back: "Back";
|
|
12
|
+
readonly done: "Done";
|
|
13
|
+
readonly details: "Details";
|
|
14
|
+
readonly cancel: "Cancel";
|
|
15
|
+
readonly filters: "Filters";
|
|
16
|
+
readonly sort: "Sort";
|
|
17
|
+
readonly reset: "Reset";
|
|
18
|
+
readonly exploreSearch: "Search";
|
|
19
|
+
readonly metricSearch: "Search metrics";
|
|
20
|
+
readonly newest: "Newest";
|
|
21
|
+
readonly oldest: "Oldest";
|
|
22
|
+
readonly longest: "Longest";
|
|
23
|
+
readonly shortest: "Shortest";
|
|
24
|
+
readonly errors: "Most errors";
|
|
25
|
+
readonly count: "Most samples";
|
|
26
|
+
readonly name: "Name";
|
|
27
|
+
readonly p95: "Highest p95";
|
|
28
|
+
readonly source: "Source";
|
|
29
|
+
readonly outcome: "Outcome";
|
|
30
|
+
readonly success: "Success";
|
|
31
|
+
readonly error: "Error";
|
|
32
|
+
readonly cancelled: "Cancelled";
|
|
33
|
+
readonly interrupted: "Interrupted";
|
|
34
|
+
readonly noErrors: "No recorded errors";
|
|
35
|
+
readonly minDuration: "Minimum duration (ms)";
|
|
36
|
+
readonly from: "From (ms since recording)";
|
|
37
|
+
readonly to: "To (ms since recording)";
|
|
38
|
+
readonly correlation: "Exact correlation ID";
|
|
39
|
+
readonly invalidRange: "Enter nonnegative numbers, with From no later than To.";
|
|
40
|
+
readonly resultCount: "{{matching}} / {{loaded}} matching";
|
|
41
|
+
readonly traceRow: "{{spans}} spans · {{errors}} errors · {{source}}";
|
|
42
|
+
readonly noResults: "No matching events. Change filters or reset to see the retained recording.";
|
|
43
|
+
readonly uncorrelated: "Uncorrelated";
|
|
44
|
+
readonly uncorrelatedHint: "{{count}} uncorrelated events are also available in Spans and Marks.";
|
|
45
|
+
readonly pauseUpdates: "Freeze view";
|
|
46
|
+
readonly resumeUpdates: "Resume live view";
|
|
47
|
+
readonly newEvents: "{{count}} new events";
|
|
48
|
+
readonly detailFrozen: "Detail is held steady while capture continues. Return to load newer events.";
|
|
49
|
+
readonly expandAll: "Expand all";
|
|
50
|
+
readonly collapseAll: "Collapse all";
|
|
51
|
+
readonly missingParent: "Parent is outside retained history.";
|
|
52
|
+
readonly wholeTrace: "Show entire trace";
|
|
53
|
+
readonly similar: "Find similar spans";
|
|
54
|
+
readonly parent: "Parent";
|
|
55
|
+
readonly children: "Children";
|
|
56
|
+
readonly attributes: "Search attributes";
|
|
57
|
+
readonly evicted: "This event is outside retained history. Showing the last inspected snapshot.";
|
|
58
|
+
readonly all: "All";
|
|
59
|
+
readonly runtime: "Runtime";
|
|
60
|
+
readonly custom: "Custom";
|
|
61
|
+
readonly metricBrief: "p95 {{p95}} · n={{count}}";
|
|
62
|
+
readonly metricSortNotice: "All retained traces. Numeric sorting compares raw values; check units when comparing series.";
|
|
63
|
+
readonly exportAll: "Recording JSON (stops recording)";
|
|
64
|
+
readonly sharePerfetto: "Perfetto trace";
|
|
65
|
+
readonly replaceTitle: "Replace current recording?";
|
|
66
|
+
readonly replaceDescription: "Start a new recording and discard the currently retained history. Export first to keep a copy.";
|
|
67
|
+
readonly retainedScope: "Counts and statistics cover retained history. Pause updates freezes this view, not recording or profiling.";
|
|
68
|
+
readonly lostHistory: "Lost {{what}}; this history is incomplete.";
|
|
69
|
+
readonly lostSpans: "{{count}} spans";
|
|
70
|
+
readonly lostMarks: "{{count}} marks";
|
|
71
|
+
readonly lostMetrics: "{{count}} metric samples";
|
|
72
|
+
readonly slowest: "Slowest spans";
|
|
73
|
+
readonly errorsOnly: "Errors";
|
|
74
|
+
readonly profileSeparate: "CPU profiles are separate from trace JSON. Stop sampling to save and share the latest artifact.";
|
|
75
|
+
readonly noProfiler: "No CPU profiler is configured for this client.";
|
|
76
|
+
readonly eyebrow: "DEVELOPER TOOLS";
|
|
77
|
+
readonly close: "Close";
|
|
78
|
+
readonly recording: "Recording live";
|
|
79
|
+
readonly stopped: "Recording stopped";
|
|
80
|
+
readonly counters: "{{events}} events · {{active}} active · {{dropped}} dropped · {{bytes}} bytes";
|
|
81
|
+
readonly start: "Start recording";
|
|
82
|
+
readonly stop: "Stop recording";
|
|
83
|
+
readonly clear: "Clear";
|
|
84
|
+
readonly export: "Stop & export";
|
|
85
|
+
readonly retention: "Bounded native history · refreshes while open";
|
|
86
|
+
readonly traces: "Traces";
|
|
87
|
+
readonly search: "Search operation or correlation ID";
|
|
88
|
+
readonly traceSummary: "{{duration}} ms · {{events}} events · {{errors}} errors";
|
|
89
|
+
readonly empty: "No traces yet. Use the app to capture activity.";
|
|
90
|
+
readonly waterfall: "Span waterfall";
|
|
91
|
+
readonly noSpans: "No completed spans in this trace.";
|
|
92
|
+
readonly spanDetails: "Span {{id}} · parent {{parent}} · {{outcome}}";
|
|
93
|
+
readonly metrics: "Metrics";
|
|
94
|
+
readonly operations: "Operation outcomes";
|
|
95
|
+
readonly operationsShort: "Operations";
|
|
96
|
+
readonly operationStats: "{{count}} spans · {{errors}} errors · {{errorRate}} error rate · {{cancelled}} cancelled · {{interrupted}} interrupted";
|
|
97
|
+
readonly metricsScope: "All traces · app.ready.after_tracer_init measures tracer setup to app readiness, not TTI. duration: series are derived from completed spans. Statistics cover retained samples, not the whole session.";
|
|
98
|
+
readonly emptyMetrics: "No samples yet. Use the app or run the playground. App-ready timing appears after a fresh launch; TTI requires an explicit readiness definition.";
|
|
99
|
+
readonly metricStats: "Latest {{latest}} · median {{median}} · min {{min}} · max {{max}} · p95 {{p95}} · {{count}} samples";
|
|
100
|
+
readonly marks: "Marks";
|
|
101
|
+
readonly playground: "Instrumentation playground";
|
|
102
|
+
readonly playgroundDescription: "Check nested spans, concurrent operations with the same name, cancellation, repeated completion, errors and metrics.";
|
|
103
|
+
readonly run: "Run sample trace";
|
|
104
|
+
readonly profiling: "CPU profile";
|
|
105
|
+
readonly profilingDescription: "Capture a native profiler artifact alongside this recording.";
|
|
106
|
+
readonly startProfile: "Start CPU profile";
|
|
107
|
+
readonly stopProfile: "Stop CPU profile";
|
|
108
|
+
readonly shareProfile: "CPU profile";
|
|
109
|
+
readonly shareArtifact: "Share performance recording";
|
|
110
|
+
readonly sharingUnavailable: "File sharing is unavailable on this device.";
|
|
111
|
+
readonly cacheUnavailable: "The application cache is unavailable.";
|
|
112
|
+
readonly truncated: "Showing up to 100 traces, spans and marks, and 40 metric series. Search to narrow traces; export includes all retained events.";
|
|
113
|
+
readonly overview: "Summary";
|
|
114
|
+
readonly tabs: "Inspector views";
|
|
115
|
+
readonly recordingSummary: "Recording summary";
|
|
116
|
+
readonly summary: "{{traces}} traces · {{spans}} spans · {{marks}} marks · {{metrics}} metric samples loaded";
|
|
117
|
+
readonly session: "Session {{id}} · elapsed {{elapsed}} ms";
|
|
118
|
+
readonly metricWindow: "Showing {{displayed}} / {{retained}} loaded samples · {{start}}–{{end}} ms since recording start";
|
|
119
|
+
readonly passed: "PASS";
|
|
120
|
+
readonly failed: "FAIL";
|
|
121
|
+
readonly scenarioResults: "Scenario results";
|
|
122
|
+
readonly scenarioNotice: "Checks inspect retained native events; dropped or expired samples can fail a check.";
|
|
123
|
+
readonly scenarioNested: "Explicit parent hierarchy";
|
|
124
|
+
readonly scenarioConcurrency: "Overlapping spans with the same name";
|
|
125
|
+
readonly scenarioCancelled: "Cancelled outcome";
|
|
126
|
+
readonly scenarioIdempotent: "Repeated completion records once";
|
|
127
|
+
readonly scenarioError: "Error outcome";
|
|
128
|
+
readonly scenarioMetrics: "Native metric values";
|
|
129
|
+
readonly openScenario: "Open scenario trace";
|
|
130
|
+
readonly timeline: "Timeline";
|
|
131
|
+
readonly issues: "Issues: {{count}}";
|
|
132
|
+
readonly noIssues: "Nothing over budget in retained history.";
|
|
133
|
+
readonly summaryScope: "Issues compare retained events with local budgets, not production percentiles. Tap a topic to explore it.";
|
|
134
|
+
readonly moreIssues: "{{count}} more in Explore";
|
|
135
|
+
readonly issueValue: "{{value}} ms · budget {{budget}} ms";
|
|
136
|
+
readonly notTracked: "Not tracked";
|
|
137
|
+
readonly quiet: "No events yet";
|
|
138
|
+
readonly topicStartup: "Startup";
|
|
139
|
+
readonly topicScreens: "Screens";
|
|
140
|
+
readonly topicNetwork: "Network";
|
|
141
|
+
readonly topicResponsiveness: "Responsiveness";
|
|
142
|
+
readonly topicErrors: "Errors";
|
|
143
|
+
readonly topicCustom: "Custom spans";
|
|
144
|
+
readonly headlineStartup: "App ready {{value}} after tracer init";
|
|
145
|
+
readonly headlineScreens: "{{count}} visits · p95 transition {{value}}";
|
|
146
|
+
readonly headlineNetwork: "{{count}} requests · p95 {{value}}";
|
|
147
|
+
readonly headlineResponsiveness: "{{count}} stalls over {{budget}} ms";
|
|
148
|
+
readonly headlineErrors: "{{count}} errors";
|
|
149
|
+
readonly headlineCustom: "{{count}} spans";
|
|
150
|
+
readonly hintStartup: "Call useAppReadyMetric(client, ready) from /react.";
|
|
151
|
+
readonly hintScreens: "Add createNavigationPlugin(navigationRef) from /plugins.";
|
|
152
|
+
readonly hintNetwork: "Add createNetworkPlugin() from /plugins.";
|
|
153
|
+
readonly hintResponsiveness: "Add createNativeMetricsPlugin(), Sentry frames, or runtimeMetrics: true.";
|
|
154
|
+
readonly hintErrors: "Add createErrorsPlugin() from /plugins.";
|
|
155
|
+
readonly hintCustom: "Use client.trace or native spans.";
|
|
156
|
+
readonly issueSlowStartup: "Slow startup";
|
|
157
|
+
readonly issueSlowScreen: "Slow screen";
|
|
158
|
+
readonly issueSlowRequest: "Slow request";
|
|
159
|
+
readonly issueFailedRequest: "Failed request";
|
|
160
|
+
readonly issueStall: "JS stall";
|
|
161
|
+
readonly issueError: "Error";
|
|
162
|
+
readonly beforeNavigation: "Before first screen";
|
|
163
|
+
readonly liveAllActivity: "All activity";
|
|
164
|
+
readonly liveInspector: "Inspector";
|
|
165
|
+
readonly liveRequests: "requests";
|
|
166
|
+
readonly liveStalls: "stalls";
|
|
167
|
+
readonly liveErrors: "errors";
|
|
168
|
+
readonly liveEmpty: "No activity on this screen yet. Use the app; events stream in here.";
|
|
169
|
+
readonly topicResources: "Resources";
|
|
170
|
+
readonly headlineResources: "CPU {{cpu}}% · {{memory}} MB";
|
|
171
|
+
readonly hintResources: "Add createNativeMetricsPlugin() from /plugins.";
|
|
172
|
+
readonly issueUiStall: "UI stall";
|
|
173
|
+
readonly issueFrozenFrames: "Frozen frames";
|
|
174
|
+
readonly liveFlag: "Flag";
|
|
175
|
+
readonly liveShare: "Share trace";
|
|
176
|
+
readonly liveFlagged: "Flagged";
|
|
177
|
+
readonly share: "Share";
|
|
178
|
+
readonly more: "More";
|
|
179
|
+
readonly shareTitle: "Share recording";
|
|
180
|
+
readonly startNew: "Start new recording";
|
|
181
|
+
readonly frozen: "Frozen";
|
|
182
|
+
readonly topics: "Topics";
|
|
183
|
+
readonly sortBy: "Sort: {{sort}}";
|
|
184
|
+
readonly filter: "Filter";
|
|
185
|
+
readonly range: "Range";
|
|
186
|
+
readonly stat_latest: "Latest";
|
|
187
|
+
readonly stat_median: "Median";
|
|
188
|
+
readonly stat_p95: "p95";
|
|
189
|
+
readonly stat_min: "Min";
|
|
190
|
+
readonly stat_max: "Max";
|
|
191
|
+
readonly samples: "Samples";
|
|
192
|
+
readonly duration: "Duration";
|
|
193
|
+
readonly time: "Time";
|
|
194
|
+
readonly spanId: "Span ID";
|
|
195
|
+
readonly correlationId: "Correlation ID";
|
|
196
|
+
readonly attributeSearch: "Search attributes";
|
|
197
|
+
};
|
|
198
|
+
export type InspectorLabels = {
|
|
199
|
+
[K in keyof typeof defaultLabels]: string;
|
|
200
|
+
};
|
|
201
|
+
export type InspectorLabelKey = keyof InspectorLabels;
|
|
202
|
+
export type InspectorTranslator = (key: InspectorLabelKey, values?: Record<string, unknown>) => string;
|
|
203
|
+
export declare const createTranslator: (labels?: Partial<InspectorLabels>) => InspectorTranslator;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type SheetOption } from './InspectorControls';
|
|
4
|
+
export interface MenuConfig {
|
|
5
|
+
title?: string;
|
|
6
|
+
options: SheetOption[];
|
|
7
|
+
cancelLabel: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* `open(config)` shows a native action sheet on iOS (UIAlertController, Liquid Glass on
|
|
11
|
+
* iOS 26) and the RN sheet elsewhere; render `element` once in the calling component.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useMenu(): {
|
|
14
|
+
open: (next: MenuConfig) => void;
|
|
15
|
+
element: React.JSX.Element | null;
|
|
16
|
+
};
|
|
17
|
+
export interface NativeTab<K extends string> {
|
|
18
|
+
key: K;
|
|
19
|
+
title: string;
|
|
20
|
+
/** SF Symbol name for the native iOS tab bar. */
|
|
21
|
+
sfSymbol: string;
|
|
22
|
+
badge?: string;
|
|
23
|
+
render: () => ReactNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Native tab bar (UITabBarController / Material) when react-native-bottom-tabs is
|
|
27
|
+
* installed; inactive screens are lazy and frozen so live ticks only render the visible tab.
|
|
28
|
+
*/
|
|
29
|
+
export declare function NativeTabs<K extends string>({ tabs, value, onChange, tint, fallback, }: {
|
|
30
|
+
tabs: NativeTab<K>[];
|
|
31
|
+
value: K;
|
|
32
|
+
onChange: (key: K) => void;
|
|
33
|
+
tint: ColorValue;
|
|
34
|
+
fallback: (content: ReactNode) => ReactNode;
|
|
35
|
+
}): React.JSX.Element;
|
|
36
|
+
/** Liquid Glass surface on iOS 26 (expo-glass-effect); a solid fallback elsewhere. */
|
|
37
|
+
export declare function Glass({ style, fallbackColor, children, interactive, }: {
|
|
38
|
+
style?: StyleProp<ViewStyle>;
|
|
39
|
+
fallbackColor: ColorValue;
|
|
40
|
+
children?: ReactNode;
|
|
41
|
+
interactive?: boolean;
|
|
42
|
+
}): React.JSX.Element;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Recording } from '../specs/Recording.nitro';
|
|
2
|
+
import type { TracePage } from '../types';
|
|
3
|
+
/** Bound work to retained history at read start, not an arbitrary UI result limit. */
|
|
4
|
+
export declare function readSnapshot(recording: Recording, previous?: TracePage): Promise<TracePage>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Minimal external store so only subscribed components rerender on telemetry ticks. */
|
|
2
|
+
export interface Store<T> {
|
|
3
|
+
get(): T;
|
|
4
|
+
set(patch: Partial<T>): void;
|
|
5
|
+
subscribe(listener: () => void): () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createStore<T extends object>(initial: T): Store<T>;
|
|
8
|
+
/** Selectors must return primitives or existing references. */
|
|
9
|
+
export declare const useStore: <T, S>(store: Store<T>, select: (value: T) => S) => S;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { MarkEvent, MetricEvent, SpanEvent, TracePage } from '../types';
|
|
2
|
+
export type TopicId = 'startup' | 'screens' | 'network' | 'responsiveness' | 'resources' | 'errors' | 'custom';
|
|
3
|
+
export declare const topicIds: TopicId[];
|
|
4
|
+
/** Text-presentation glyphs (no color emoji) and system tints per topic. */
|
|
5
|
+
export declare const topicGlyph: Record<TopicId, {
|
|
6
|
+
icon: string;
|
|
7
|
+
color: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** Local triage thresholds, not production SLOs. */
|
|
10
|
+
export interface Budgets {
|
|
11
|
+
appReadyMs: number;
|
|
12
|
+
screenMs: number;
|
|
13
|
+
requestMs: number;
|
|
14
|
+
stallMs: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const defaultBudgets: Budgets;
|
|
17
|
+
export type AnyEvent = SpanEvent | MarkEvent | MetricEvent;
|
|
18
|
+
export type IssueKind = 'slowStartup' | 'slowScreen' | 'slowRequest' | 'failedRequest' | 'stall' | 'uiStall' | 'frozenFrames' | 'error';
|
|
19
|
+
export interface Issue {
|
|
20
|
+
kind: IssueKind;
|
|
21
|
+
topic: TopicId;
|
|
22
|
+
title: string;
|
|
23
|
+
valueMs?: number;
|
|
24
|
+
budgetMs?: number;
|
|
25
|
+
event: AnyEvent;
|
|
26
|
+
/** Errors outrank budget overruns; overruns rank by value / budget. */
|
|
27
|
+
severity: number;
|
|
28
|
+
}
|
|
29
|
+
export interface TopicSummary {
|
|
30
|
+
id: TopicId;
|
|
31
|
+
/** A collector is configured or the topic has events. */
|
|
32
|
+
tracked: boolean;
|
|
33
|
+
count: number;
|
|
34
|
+
/** Nearest-rank p95 (screens: transition, network: duration) or latest app-ready. */
|
|
35
|
+
value?: number;
|
|
36
|
+
/** Extra headline values, e.g. resources: latest cpu and memory. */
|
|
37
|
+
values?: Record<string, string>;
|
|
38
|
+
issues: Issue[];
|
|
39
|
+
}
|
|
40
|
+
export declare const attribute: (event: AnyEvent, key: string) => string | undefined;
|
|
41
|
+
export declare const topicOf: (event: AnyEvent) => TopicId;
|
|
42
|
+
export declare const summarizeTopics: (page: TracePage, collectors: readonly string[], budgets?: Budgets) => {
|
|
43
|
+
topics: TopicSummary[];
|
|
44
|
+
issues: Issue[];
|
|
45
|
+
};
|
|
46
|
+
export type TimelineItem = {
|
|
47
|
+
kind: 'screen';
|
|
48
|
+
key: string;
|
|
49
|
+
name: string;
|
|
50
|
+
timestampMs: number;
|
|
51
|
+
} | {
|
|
52
|
+
kind: 'event';
|
|
53
|
+
key: string;
|
|
54
|
+
event: AnyEvent;
|
|
55
|
+
topic: TopicId;
|
|
56
|
+
issue: boolean;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Newest screen visit first, each followed by its events newest first. Visits come from
|
|
60
|
+
* `navigation.enter` marks, so the active screen appears before its visit span completes.
|
|
61
|
+
* Metrics are listed only when they are issues; periodic samples belong in Metrics.
|
|
62
|
+
*/
|
|
63
|
+
export declare const buildTimeline: (page: TracePage, issues: readonly Issue[], limit?: number) => TimelineItem[];
|
|
64
|
+
export declare const currentScreen: (page: TracePage) => string | undefined;
|
|
65
|
+
export interface VisitSummary {
|
|
66
|
+
/** Undefined when no navigation collector has recorded a screen yet. */
|
|
67
|
+
screen?: string;
|
|
68
|
+
sinceMs?: number;
|
|
69
|
+
events: Extract<TimelineItem, {
|
|
70
|
+
kind: 'event';
|
|
71
|
+
}>[];
|
|
72
|
+
requests: number;
|
|
73
|
+
stalls: number;
|
|
74
|
+
errors: number;
|
|
75
|
+
issues: number;
|
|
76
|
+
}
|
|
77
|
+
/** The newest screen visit in a timeline: what happened on the screen the user is looking at. */
|
|
78
|
+
export declare const currentVisit: (items: readonly TimelineItem[]) => VisitSummary;
|
|
79
|
+
/** Latest sample of a metric by name; undefined when not collected. */
|
|
80
|
+
export declare const latestMetric: (page: TracePage, name: string) => number | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TraceClient } from '../client/createTraceClient';
|
|
2
|
+
import type { TracePage } from '../types';
|
|
3
|
+
/** Incremental polling of the active recording; unchanged snapshots keep their identity. */
|
|
4
|
+
export declare function useLiveRecording(client: TraceClient, active: boolean, intervalMs?: number): TracePage | undefined;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import type { TraceClient } from '../client/createTraceClient';
|
|
2
|
+
import type { RecordingStats, TracePage, SpanEvent, MarkEvent } from '../types';
|
|
3
|
+
import { type ExplorerMode, type Query, type Trace } from './explorerModel';
|
|
4
|
+
import { recordingMetrics } from './viewerModel';
|
|
5
|
+
import { type Budgets } from './topics';
|
|
6
|
+
export type Metric = ReturnType<typeof recordingMetrics>[number];
|
|
7
|
+
export type Detail = {
|
|
8
|
+
kind: 'trace';
|
|
9
|
+
value: Trace;
|
|
10
|
+
} | {
|
|
11
|
+
kind: 'span';
|
|
12
|
+
value: SpanEvent;
|
|
13
|
+
} | {
|
|
14
|
+
kind: 'mark';
|
|
15
|
+
value: MarkEvent;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'metric';
|
|
18
|
+
value: Metric;
|
|
19
|
+
};
|
|
20
|
+
export type Tab = 'overview' | 'timeline' | 'explore' | 'metrics' | 'tools';
|
|
21
|
+
export interface Telemetry {
|
|
22
|
+
stats?: RecordingStats;
|
|
23
|
+
error?: string;
|
|
24
|
+
pending?: Pick<TracePage, 'nextSequence' | 'earliestSequence'>;
|
|
25
|
+
}
|
|
26
|
+
export declare const useTraceViewer: (client: TraceClient, budgets?: Partial<Budgets>) => {
|
|
27
|
+
client: {
|
|
28
|
+
reportAppReady(): void;
|
|
29
|
+
trace: {
|
|
30
|
+
mark(name: string, attributes?: import("../client/createTraceClient").ClientAttributes): void;
|
|
31
|
+
metric(name: string, value: number | string, attributes?: import("../client/createTraceClient").ClientAttributes): void;
|
|
32
|
+
measure<T>(name: string, fn: () => Promise<T>, attributes?: import("../client/createTraceClient").ClientAttributes): Promise<T>;
|
|
33
|
+
measureSince(name: string, startName: string, id: string, attributes?: import("../client/createTraceClient").ClientAttributes): void;
|
|
34
|
+
clear(id: string): void;
|
|
35
|
+
};
|
|
36
|
+
start: () => Promise<void>;
|
|
37
|
+
stop: () => Promise<void>;
|
|
38
|
+
clear: () => Promise<void>;
|
|
39
|
+
getRecording: () => import("..").Recording | undefined;
|
|
40
|
+
getError: () => string | undefined;
|
|
41
|
+
getSnapshot: () => import("../client/createTraceClient").TraceClientSnapshot;
|
|
42
|
+
subscribe(listener: () => void): () => void;
|
|
43
|
+
open(): void;
|
|
44
|
+
close(): void;
|
|
45
|
+
reportError: (error: unknown) => void;
|
|
46
|
+
canShare: boolean;
|
|
47
|
+
canProfile: boolean;
|
|
48
|
+
canShareProfile: boolean;
|
|
49
|
+
export: () => Promise<void>;
|
|
50
|
+
shareTrace: (format?: import("../client/createTraceClient").TraceFormat) => Promise<void>;
|
|
51
|
+
flag: (note?: string) => void;
|
|
52
|
+
toggleProfile: () => Promise<void>;
|
|
53
|
+
shareProfile: () => Promise<void>;
|
|
54
|
+
playground: () => Promise<void>;
|
|
55
|
+
dispose(): Promise<void>;
|
|
56
|
+
};
|
|
57
|
+
tab: Tab;
|
|
58
|
+
setTab: (next: Tab) => void;
|
|
59
|
+
mode: ExplorerMode;
|
|
60
|
+
setMode: import("react").Dispatch<import("react").SetStateAction<ExplorerMode>>;
|
|
61
|
+
page: TracePage;
|
|
62
|
+
telemetry: import("./store").Store<Telemetry>;
|
|
63
|
+
traces: Trace[];
|
|
64
|
+
topics: import("./topics").TopicSummary[];
|
|
65
|
+
issues: import("./topics").Issue[];
|
|
66
|
+
timeline: import("./topics").TimelineItem[];
|
|
67
|
+
screen: string | undefined;
|
|
68
|
+
results: import("./explorerModel").Event[] | Trace[];
|
|
69
|
+
query: Query;
|
|
70
|
+
updateQuery: (patch: Partial<Query>) => void;
|
|
71
|
+
resetQuery: () => void;
|
|
72
|
+
loaded: number;
|
|
73
|
+
uncorrelated: number;
|
|
74
|
+
detail: Detail;
|
|
75
|
+
detailState: import("react").RefObject<Record<string, {
|
|
76
|
+
collapsed: string[];
|
|
77
|
+
layout: "waterfall" | "list";
|
|
78
|
+
attributes: string;
|
|
79
|
+
offset: number;
|
|
80
|
+
}>>;
|
|
81
|
+
details: Detail[];
|
|
82
|
+
open: (next: Detail) => void;
|
|
83
|
+
back: () => void;
|
|
84
|
+
traceFor: (span: SpanEvent) => Trace | undefined;
|
|
85
|
+
showSpans: (patch: Partial<Query>) => void;
|
|
86
|
+
showMarks: (patch: Partial<Query>) => void;
|
|
87
|
+
paused: boolean;
|
|
88
|
+
holding: boolean;
|
|
89
|
+
setHolding: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
90
|
+
apply: () => void;
|
|
91
|
+
togglePause: () => void;
|
|
92
|
+
offsets: import("react").RefObject<Record<string, number>>;
|
|
93
|
+
metrics: {
|
|
94
|
+
latest: number;
|
|
95
|
+
median: number;
|
|
96
|
+
min: number;
|
|
97
|
+
peak: number;
|
|
98
|
+
p95: number;
|
|
99
|
+
name: string;
|
|
100
|
+
metric: string;
|
|
101
|
+
unit: string;
|
|
102
|
+
samples: import("..").MetricEvent[];
|
|
103
|
+
retainedCount: number;
|
|
104
|
+
startMs: number;
|
|
105
|
+
endMs: number;
|
|
106
|
+
max: number;
|
|
107
|
+
}[];
|
|
108
|
+
operations: {
|
|
109
|
+
name: string;
|
|
110
|
+
count: number;
|
|
111
|
+
errors: number;
|
|
112
|
+
errorRate: number | undefined;
|
|
113
|
+
cancelled: number;
|
|
114
|
+
interrupted: number;
|
|
115
|
+
}[];
|
|
116
|
+
metricQuery: string;
|
|
117
|
+
setMetricQuery: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
118
|
+
metricCategory: string;
|
|
119
|
+
setMetricCategory: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
120
|
+
metricSort: string;
|
|
121
|
+
setMetricSort: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
122
|
+
start: () => void;
|
|
123
|
+
stop: () => void;
|
|
124
|
+
export: () => void;
|
|
125
|
+
sharePerfetto: () => void;
|
|
126
|
+
toggleProfile: () => void;
|
|
127
|
+
shareProfile: () => void;
|
|
128
|
+
playground: () => void;
|
|
129
|
+
playgroundResult: import("../client/playground").PlaygroundReport | undefined;
|
|
130
|
+
openPlayground: () => void;
|
|
131
|
+
visible: boolean;
|
|
132
|
+
recording: boolean;
|
|
133
|
+
busy: boolean;
|
|
134
|
+
disposed: boolean;
|
|
135
|
+
error?: string;
|
|
136
|
+
profiling: boolean;
|
|
137
|
+
profilePath?: string;
|
|
138
|
+
collectors?: string[];
|
|
139
|
+
};
|
|
140
|
+
export type Viewer = ReturnType<typeof useTraceViewer>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { MetricEvent, SpanEvent, TracePage } from '../types';
|
|
2
|
+
export interface TraceGroup {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
start: number;
|
|
6
|
+
duration: number;
|
|
7
|
+
errors: number;
|
|
8
|
+
events: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const groupTraces: (page: TracePage, query: string) => TraceGroup[];
|
|
11
|
+
export declare const waterfall: (spans: SpanEvent[]) => {
|
|
12
|
+
span: SpanEvent;
|
|
13
|
+
depth: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
width: number;
|
|
16
|
+
}[];
|
|
17
|
+
/** Human value with unit: 3653 ms → "3.65 s", 1240 MB → "1.21 GB". */
|
|
18
|
+
export declare const formatMetric: (value: number, unit: string) => string;
|
|
19
|
+
export declare const metricSeries: (metrics: MetricEvent[]) => {
|
|
20
|
+
latest: number;
|
|
21
|
+
median: number;
|
|
22
|
+
min: number;
|
|
23
|
+
peak: number;
|
|
24
|
+
p95: number;
|
|
25
|
+
name: string;
|
|
26
|
+
/** Metric name without the unit suffix used for grouping. */
|
|
27
|
+
metric: string;
|
|
28
|
+
unit: string;
|
|
29
|
+
samples: MetricEvent[];
|
|
30
|
+
retainedCount: number;
|
|
31
|
+
startMs: number;
|
|
32
|
+
endMs: number;
|
|
33
|
+
max: number;
|
|
34
|
+
}[];
|
|
35
|
+
/** Durations are derived from retained completed spans, not additional native samples. */
|
|
36
|
+
export declare const recordingMetrics: (page: TracePage) => {
|
|
37
|
+
latest: number;
|
|
38
|
+
median: number;
|
|
39
|
+
min: number;
|
|
40
|
+
peak: number;
|
|
41
|
+
p95: number;
|
|
42
|
+
name: string;
|
|
43
|
+
/** Metric name without the unit suffix used for grouping. */
|
|
44
|
+
metric: string;
|
|
45
|
+
unit: string;
|
|
46
|
+
samples: MetricEvent[];
|
|
47
|
+
retainedCount: number;
|
|
48
|
+
startMs: number;
|
|
49
|
+
endMs: number;
|
|
50
|
+
max: number;
|
|
51
|
+
}[];
|
|
52
|
+
export declare const operationMetrics: (spans: SpanEvent[]) => {
|
|
53
|
+
name: string;
|
|
54
|
+
count: number;
|
|
55
|
+
errors: number;
|
|
56
|
+
errorRate: number | undefined;
|
|
57
|
+
cancelled: number;
|
|
58
|
+
interrupted: number;
|
|
59
|
+
}[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { TraceSpan } from './TraceSpan.nitro';
|
|
3
|
+
import type { CompletedSpanOptions, SpanOptions, MarkOptions, MetricOptions, ReadOptions, TracePage, RecordingStats, NativeSamplingOptions } from '../types';
|
|
4
|
+
/** Owns bounded native history. Stop before export; dispose when all readers are done. */
|
|
5
|
+
export interface Recording extends HybridObject<{
|
|
6
|
+
ios: 'c++';
|
|
7
|
+
android: 'c++';
|
|
8
|
+
}> {
|
|
9
|
+
/** Start a span, optionally linked to an explicit parent. */
|
|
10
|
+
startSpan(options: SpanOptions): TraceSpan;
|
|
11
|
+
/** Import a completed measurement; returns its native span identity. */
|
|
12
|
+
recordSpan(options: CompletedSpanOptions): string;
|
|
13
|
+
/** Append a point event. */
|
|
14
|
+
mark(options: MarkOptions): void;
|
|
15
|
+
/** Append a finite numeric sample with units. */
|
|
16
|
+
recordMetric(options: MetricOptions): void;
|
|
17
|
+
/** Read at most 1000 completed events without per-event callbacks. */
|
|
18
|
+
readEvents(options: ReadOptions): Promise<TracePage>;
|
|
19
|
+
/** Read cheap recording counters and clock anchor. */
|
|
20
|
+
getStats(): RecordingStats;
|
|
21
|
+
/** Freeze history and close active spans as interrupted. Idempotent. */
|
|
22
|
+
stop(): void;
|
|
23
|
+
/** Serialize a snapshot off the JS thread; includes schema version and clock anchor. */
|
|
24
|
+
exportJson(): Promise<string>;
|
|
25
|
+
/** Chrome Trace Event JSON for ui.perfetto.dev; serialized off the JS thread. */
|
|
26
|
+
exportTraceEvents(): Promise<string>;
|
|
27
|
+
/** Start a native thread writing process.cpu, process.memory and ui.* frame metrics. Replaces a running sampler. */
|
|
28
|
+
startNativeSampling(options: NativeSamplingOptions): void;
|
|
29
|
+
/** Stop native sampling. Idempotent; stop() and dispose() also stop it. */
|
|
30
|
+
stopNativeSampling(): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { SpanOutcome } from '../types';
|
|
3
|
+
/** A native span handle returned by Recording.startSpan. */
|
|
4
|
+
export interface TraceSpan extends HybridObject<{
|
|
5
|
+
ios: 'c++';
|
|
6
|
+
android: 'c++';
|
|
7
|
+
}> {
|
|
8
|
+
/** Empty when rejected by capacity limits. */
|
|
9
|
+
readonly spanId: string;
|
|
10
|
+
/** Whether capacity allowed this span to be recorded. */
|
|
11
|
+
readonly recorded: boolean;
|
|
12
|
+
/** Complete once. Repeated completion and completion after stop are no-ops. */
|
|
13
|
+
end(outcome: SpanOutcome): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HybridObject } from 'react-native-nitro-modules';
|
|
2
|
+
import type { Recording } from './Recording.nitro';
|
|
3
|
+
import type { RecordingOptions } from '../types';
|
|
4
|
+
/** Factory for independent native recordings. Exported as Tracing. */
|
|
5
|
+
export interface Tracing extends HybridObject<{
|
|
6
|
+
ios: 'c++';
|
|
7
|
+
android: 'c++';
|
|
8
|
+
}> {
|
|
9
|
+
/** Create an active recording with explicit validated retention limits. */
|
|
10
|
+
startRecording(options: RecordingOptions): Recording;
|
|
11
|
+
/**
|
|
12
|
+
* Stop Hermes' process-wide sampling profiler. The release-profiler plugin calls this
|
|
13
|
+
* after saving a profile: on React Native 0.85 Android the profiler's own stop restarts
|
|
14
|
+
* sampling. Returns false where Hermes is not linked (iOS stops correctly itself).
|
|
15
|
+
*/
|
|
16
|
+
disableHermesSampling(): boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SpanOutcome } from './SpanOutcome';
|
|
2
|
+
import type { SpanOptions } from './SpanOptions';
|
|
3
|
+
/** Completed external measurement in Recording's native clock domain. */
|
|
4
|
+
export interface CompletedSpanOptions extends SpanOptions {
|
|
5
|
+
/** Optional source-qualified identity, for example sentry:traceId:spanId. */
|
|
6
|
+
sourceSpanId?: string;
|
|
7
|
+
/** Source-qualified parent identity; resolves even when parent ends later. */
|
|
8
|
+
sourceParentSpanId?: string;
|
|
9
|
+
/** Start in milliseconds relative to recording creation. */
|
|
10
|
+
timestampMs: number;
|
|
11
|
+
/** Finite nonnegative duration. */
|
|
12
|
+
durationMs: number;
|
|
13
|
+
/** Terminal result from the measurement source. */
|
|
14
|
+
outcome: SpanOutcome;
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TraceContext } from './TraceContext';
|
|
2
|
+
/** Immutable native event identity and timing shared by recorded variants. */
|
|
3
|
+
export interface EventContext extends TraceContext {
|
|
4
|
+
/** Increasing session-local completion sequence. */
|
|
5
|
+
sequence: number;
|
|
6
|
+
/** Milliseconds since recording creation on its native monotonic clock. */
|
|
7
|
+
timestampMs: number;
|
|
8
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TraceContext } from './TraceContext';
|
|
2
|
+
/** Native mark, optionally imported with a translated source timestamp. */
|
|
3
|
+
export interface MarkOptions extends TraceContext {
|
|
4
|
+
/** Milliseconds in the recording clock; omit to record now. */
|
|
5
|
+
timestampMs?: number;
|
|
6
|
+
}
|