Skip to content

Commit d7df098

Browse files
feat(types): Add missing Profiling types (macho debug image, profile measurements, stack frame properties) (#9277)
1 parent 45d51f6 commit d7df098

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

packages/types/src/debugMeta.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export interface DebugMeta {
55
images?: Array<DebugImage>;
66
}
77

8-
export type DebugImage = WasmDebugImage | SourceMapDebugImage;
8+
export type DebugImage = WasmDebugImage | SourceMapDebugImage | MachoDebugImage;
99

1010
interface WasmDebugImage {
1111
type: 'wasm';
@@ -20,3 +20,11 @@ interface SourceMapDebugImage {
2020
code_file: string; // filename
2121
debug_id: string; // uuid
2222
}
23+
24+
interface MachoDebugImage {
25+
type: 'macho';
26+
debug_id: string;
27+
image_addr: string;
28+
image_size?: number;
29+
code_file?: string;
30+
}

packages/types/src/profiling.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
import type { DebugImage } from './debugMeta';
2+
import type { MeasurementUnit } from './measurement';
3+
24
export type ThreadId = string;
35
export type FrameId = number;
46
export type StackId = number;
57

68
export interface ThreadCpuSample {
79
stack_id: StackId;
810
thread_id: ThreadId;
11+
queue_address?: string;
912
elapsed_since_start_ns: string;
1013
}
1114

1215
export type ThreadCpuStack = FrameId[];
1316

1417
export type ThreadCpuFrame = {
15-
function: string;
18+
function?: string;
1619
file?: string;
1720
lineno?: number;
1821
colno?: number;
1922
abs_path?: string;
23+
platform?: string;
24+
instruction_addr?: string;
25+
module?: string;
26+
in_app?: boolean;
2027
};
2128

2229
export interface ThreadCpuProfile {
@@ -68,4 +75,14 @@ export interface Profile {
6875
relative_start_ns: string;
6976
relative_end_ns: string;
7077
}[];
78+
measurements?: Record<
79+
string,
80+
{
81+
unit: MeasurementUnit;
82+
values: {
83+
elapsed_since_start_ns: number;
84+
value: number;
85+
}[];
86+
}
87+
>;
7188
}

0 commit comments

Comments
 (0)