-
Notifications
You must be signed in to change notification settings - Fork 9
/
EventInterfaces.ts
192 lines (162 loc) · 4.06 KB
/
EventInterfaces.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
import { EventsPhase } from './Phases';
// All of the event types in this module are not currently
// being used, but they are included here for completeness
// for future implementers
export interface SharedEventProperties {
/**
* name of the event
*/
name?: string;
/**
* event category
*/
cat?: string;
/**
* tracing clock timestamp
*/
ts?: number;
/**
* process ID
*/
pid?: number;
/**
* thread ID
*/
tid?: number;
/**
* event type (phase)
*/
ph: EventsPhase;
/**
* id for a stackFrame object
*/
sf?: number;
/**
* thread clock timestamp
*/
tts?: number;
/**
* a fixed color name
*/
cname?: string;
/**
* event arguments
*/
args?: {
[key in string]: any;
};
}
interface DurationEventBegin extends SharedEventProperties {
ph: EventsPhase.DURATION_EVENTS_BEGIN;
}
interface DurationEventEnd extends SharedEventProperties {
ph: EventsPhase.DURATION_EVENTS_END;
}
export type DurationEvent = DurationEventBegin | DurationEventEnd;
export interface CompleteEvent extends SharedEventProperties {
ph: EventsPhase.COMPLETE_EVENTS;
dur: number;
}
export interface MetadataEvent extends SharedEventProperties {
ph: EventsPhase.METADATA_EVENTS;
}
export interface SampleEvent extends SharedEventProperties {
ph: EventsPhase.SAMPLE_EVENTS;
}
interface ObjectEventCreated extends SharedEventProperties {
ph: EventsPhase.OBJECT_EVENTS_CREATED;
scope?: string;
}
interface ObjectEventSnapshot extends SharedEventProperties {
ph: EventsPhase.OBJECT_EVENTS_SNAPSHOT;
scope?: string;
}
interface ObjectEventDestroyed extends SharedEventProperties {
ph: EventsPhase.OBJECT_EVENTS_DESTROYED;
scope?: string;
}
export type ObjectEvent =
| ObjectEventCreated
| ObjectEventSnapshot
| ObjectEventDestroyed;
export interface ClockSyncEvent extends SharedEventProperties {
ph: EventsPhase.CLOCK_SYNC_EVENTS;
args: {
sync_id: string;
issue_ts?: number;
};
}
interface ContextEventEnter extends SharedEventProperties {
ph: EventsPhase.CONTEXT_EVENTS_ENTER;
}
interface ContextEventLeave extends SharedEventProperties {
ph: EventsPhase.CONTEXT_EVENTS_LEAVE;
}
export type ContextEvent = ContextEventEnter | ContextEventLeave;
interface AsyncEventStart extends SharedEventProperties {
ph: EventsPhase.ASYNC_EVENTS_NESTABLE_START;
id: number;
scope?: string;
}
interface AsyncEventInstant extends SharedEventProperties {
ph: EventsPhase.ASYNC_EVENTS_NESTABLE_INSTANT;
id: number;
scope?: string;
}
interface AsyncEventEnd extends SharedEventProperties {
ph: EventsPhase.ASYNC_EVENTS_NESTABLE_END;
id: number;
scope?: string;
}
export type AsyncEvent = AsyncEventStart | AsyncEventInstant | AsyncEventEnd;
export interface InstantEvent extends SharedEventProperties {
ph: EventsPhase.INSTANT_EVENTS;
s: string;
}
export interface CounterEvent extends SharedEventProperties {
ph: EventsPhase.COUNTER_EVENTS;
}
interface FlowEventStart extends SharedEventProperties {
ph: EventsPhase.FLOW_EVENTS_START;
}
interface FlowEventStep extends SharedEventProperties {
ph: EventsPhase.FLOW_EVENTS_STEP;
}
interface FlowEventEnd extends SharedEventProperties {
ph: EventsPhase.FLOW_EVENTS_END;
}
export type FlowEvent = FlowEventStart | FlowEventStep | FlowEventEnd;
interface MemoryDumpGlobal extends SharedEventProperties {
ph: EventsPhase.MEMORY_DUMP_EVENTS_GLOBAL;
id: string;
}
interface MemoryDumpProcess extends SharedEventProperties {
ph: EventsPhase.MEMORY_DUMP_EVENTS_PROCESS;
id: string;
}
export type MemoryDumpEvent = MemoryDumpGlobal | MemoryDumpProcess;
export interface MarkEvent extends SharedEventProperties {
ph: EventsPhase.MARK_EVENTS;
}
export interface LinkedIDEvent extends SharedEventProperties {
ph: EventsPhase.LINKED_ID_EVENTS;
id: number;
args: {
linked_id: number;
};
}
export type Event =
| DurationEvent
| CompleteEvent
| MetadataEvent
| SampleEvent
| ObjectEvent
| ClockSyncEvent
| ContextEvent
| AsyncEvent
| InstantEvent
| CounterEvent
| FlowEvent
| MemoryDumpEvent
| MarkEvent
| LinkedIDEvent;