UNPKG

3.11 kBTypeScriptView Raw
1import type { DebugImage } from './debugMeta';
2import type { MeasurementUnit } from './measurement';
3export type ThreadId = string;
4export type FrameId = number;
5export type StackId = number;
6export interface ThreadCpuSample {
7 stack_id: StackId;
8 thread_id: ThreadId;
9 queue_address?: string;
10 elapsed_since_start_ns: string;
11}
12export interface ContinuousThreadCpuSample {
13 stack_id: StackId;
14 thread_id: ThreadId;
15 queue_address?: string;
16 timestamp: number;
17}
18export type ThreadCpuStack = FrameId[];
19export type ThreadCpuFrame = {
20 function?: string;
21 file?: string;
22 lineno?: number;
23 colno?: number;
24 abs_path?: string;
25 platform?: string;
26 instruction_addr?: string;
27 module?: string;
28 in_app?: boolean;
29};
30export interface ThreadCpuProfile {
31 samples: ThreadCpuSample[];
32 stacks: ThreadCpuStack[];
33 frames: ThreadCpuFrame[];
34 thread_metadata: Record<ThreadId, {
35 name?: string;
36 priority?: number;
37 }>;
38 queue_metadata?: Record<string, {
39 label: string;
40 }>;
41}
42export interface ContinuousThreadCpuProfile {
43 samples: ContinuousThreadCpuSample[];
44 stacks: ThreadCpuStack[];
45 frames: ThreadCpuFrame[];
46 thread_metadata: Record<ThreadId, {
47 name?: string;
48 priority?: number;
49 }>;
50 queue_metadata?: Record<string, {
51 label: string;
52 }>;
53}
54interface BaseProfile<T> {
55 version: string;
56 release: string;
57 environment: string;
58 platform: string;
59 profile: T;
60 debug_meta?: {
61 images: DebugImage[];
62 };
63 measurements?: Record<string, {
64 unit: MeasurementUnit;
65 values: {
66 elapsed_since_start_ns: number;
67 value: number;
68 }[];
69 }>;
70}
71export interface Profile extends BaseProfile<ThreadCpuProfile> {
72 event_id: string;
73 version: string;
74 os: {
75 name: string;
76 version: string;
77 build_number?: string;
78 };
79 runtime: {
80 name: string;
81 version: string;
82 };
83 device: {
84 architecture: string;
85 is_emulator: boolean;
86 locale: string;
87 manufacturer: string;
88 model: string;
89 };
90 timestamp: string;
91 release: string;
92 environment: string;
93 platform: string;
94 profile: ThreadCpuProfile;
95 debug_meta?: {
96 images: DebugImage[];
97 };
98 transaction?: {
99 name: string;
100 id: string;
101 trace_id: string;
102 active_thread_id: string;
103 };
104 transactions?: {
105 name: string;
106 id: string;
107 trace_id: string;
108 active_thread_id: string;
109 relative_start_ns: string;
110 relative_end_ns: string;
111 }[];
112 measurements?: Record<string, {
113 unit: MeasurementUnit;
114 values: {
115 elapsed_since_start_ns: number;
116 value: number;
117 }[];
118 }>;
119}
120export interface ProfileChunk extends BaseProfile<ContinuousThreadCpuProfile> {
121 chunk_id: string;
122 profiler_id: string;
123 client_sdk: {
124 name: string;
125 version: string;
126 };
127}
128export {};
129//# sourceMappingURL=profiling.d.ts.map
\No newline at end of file