Skip to content

Commit 0d8eda3

Browse files
feat(types): Add macho debug image and measurements to Profile type
1 parent cadeefe commit 0d8eda3

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
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: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import type { DebugImage } from './debugMeta';
2+
import { 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

@@ -68,4 +71,11 @@ export interface Profile {
6871
relative_start_ns: string;
6972
relative_end_ns: string;
7073
}[];
74+
measurements?: Record<string, {
75+
unit: MeasurementUnit;
76+
values: {
77+
elapsed_since_start_ns: number;
78+
value: number;
79+
}[];
80+
}>;
7181
}

0 commit comments

Comments
 (0)