1use super::runtime;
3#[allow(unused_imports)]
4use super::types::*;
5#[allow(unused_imports)]
6use serde::{Deserialize, Serialize};
7#[allow(unused_imports)]
8use serde_json::Value as Json;
9pub type HeapSnapshotObjectId = String;
10#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
11pub struct SamplingHeapProfileNode {
12 #[serde(rename = "callFrame")]
13 pub call_frame: runtime::CallFrame,
14 #[serde(default)]
15 #[serde(rename = "selfSize")]
16 pub self_size: JsFloat,
17 #[serde(default)]
18 #[serde(rename = "id")]
19 pub id: JsUInt,
20 #[serde(rename = "children")]
21 pub children: Vec<SamplingHeapProfileNode>,
22}
23#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
24pub struct SamplingHeapProfileSample {
25 #[serde(default)]
26 #[serde(rename = "size")]
27 pub size: JsFloat,
28 #[serde(default)]
29 #[serde(rename = "nodeId")]
30 pub node_id: JsUInt,
31 #[serde(default)]
32 #[serde(rename = "ordinal")]
33 pub ordinal: JsFloat,
34}
35#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
36pub struct SamplingHeapProfile {
37 #[serde(rename = "head")]
38 pub head: SamplingHeapProfileNode,
39 #[serde(rename = "samples")]
40 pub samples: Vec<SamplingHeapProfileSample>,
41}
42#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
43pub struct AddInspectedHeapObject {
44 #[serde(rename = "heapObjectId")]
45 pub heap_object_id: HeapSnapshotObjectId,
46}
47#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
48#[serde(rename_all = "camelCase")]
49pub struct CollectGarbage(pub Option<serde_json::Value>);
50#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
51#[serde(rename_all = "camelCase")]
52pub struct Disable(pub Option<serde_json::Value>);
53#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
54#[serde(rename_all = "camelCase")]
55pub struct Enable(pub Option<serde_json::Value>);
56#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
57pub struct GetHeapObjectId {
58 #[serde(rename = "objectId")]
59 pub object_id: runtime::RemoteObjectId,
60}
61#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
62pub struct GetObjectByHeapObjectId {
63 #[serde(rename = "objectId")]
64 pub object_id: HeapSnapshotObjectId,
65 #[serde(skip_serializing_if = "Option::is_none")]
66 #[serde(default)]
67 #[serde(rename = "objectGroup")]
68 pub object_group: Option<String>,
69}
70#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
71#[serde(rename_all = "camelCase")]
72pub struct GetSamplingProfile(pub Option<serde_json::Value>);
73#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
74pub struct StartSampling {
75 #[serde(skip_serializing_if = "Option::is_none")]
76 #[serde(default)]
77 #[serde(rename = "samplingInterval")]
78 pub sampling_interval: Option<JsFloat>,
79 #[serde(skip_serializing_if = "Option::is_none")]
80 #[serde(default)]
81 #[serde(rename = "includeObjectsCollectedByMajorGC")]
82 pub include_objects_collected_by_major_gc: Option<bool>,
83 #[serde(skip_serializing_if = "Option::is_none")]
84 #[serde(default)]
85 #[serde(rename = "includeObjectsCollectedByMinorGC")]
86 pub include_objects_collected_by_minor_gc: Option<bool>,
87}
88#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
89pub struct StartTrackingHeapObjects {
90 #[serde(skip_serializing_if = "Option::is_none")]
91 #[serde(default)]
92 #[serde(rename = "trackAllocations")]
93 pub track_allocations: Option<bool>,
94}
95#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
96#[serde(rename_all = "camelCase")]
97pub struct StopSampling(pub Option<serde_json::Value>);
98#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
99pub struct StopTrackingHeapObjects {
100 #[serde(skip_serializing_if = "Option::is_none")]
101 #[serde(default)]
102 #[serde(rename = "reportProgress")]
103 pub report_progress: Option<bool>,
104 #[serde(skip_serializing_if = "Option::is_none")]
105 #[serde(default)]
106 #[serde(rename = "treatGlobalObjectsAsRoots")]
107 pub treat_global_objects_as_roots: Option<bool>,
108 #[serde(skip_serializing_if = "Option::is_none")]
109 #[serde(default)]
110 #[serde(rename = "captureNumericValue")]
111 pub capture_numeric_value: Option<bool>,
112 #[serde(skip_serializing_if = "Option::is_none")]
113 #[serde(default)]
114 #[serde(rename = "exposeInternals")]
115 pub expose_internals: Option<bool>,
116}
117#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
118pub struct TakeHeapSnapshot {
119 #[serde(skip_serializing_if = "Option::is_none")]
120 #[serde(default)]
121 #[serde(rename = "reportProgress")]
122 pub report_progress: Option<bool>,
123 #[serde(skip_serializing_if = "Option::is_none")]
124 #[serde(default)]
125 #[serde(rename = "treatGlobalObjectsAsRoots")]
126 pub treat_global_objects_as_roots: Option<bool>,
127 #[serde(skip_serializing_if = "Option::is_none")]
128 #[serde(default)]
129 #[serde(rename = "captureNumericValue")]
130 pub capture_numeric_value: Option<bool>,
131 #[serde(skip_serializing_if = "Option::is_none")]
132 #[serde(default)]
133 #[serde(rename = "exposeInternals")]
134 pub expose_internals: Option<bool>,
135}
136#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
137#[serde(rename_all = "camelCase")]
138pub struct AddInspectedHeapObjectReturnObject {}
139#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
140#[serde(rename_all = "camelCase")]
141pub struct CollectGarbageReturnObject {}
142#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
143#[serde(rename_all = "camelCase")]
144pub struct DisableReturnObject {}
145#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
146#[serde(rename_all = "camelCase")]
147pub struct EnableReturnObject {}
148#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
149pub struct GetHeapObjectIdReturnObject {
150 #[serde(rename = "heapSnapshotObjectId")]
151 pub heap_snapshot_object_id: HeapSnapshotObjectId,
152}
153#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
154pub struct GetObjectByHeapObjectIdReturnObject {
155 #[serde(rename = "result")]
156 pub result: runtime::RemoteObject,
157}
158#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
159pub struct GetSamplingProfileReturnObject {
160 #[serde(rename = "profile")]
161 pub profile: SamplingHeapProfile,
162}
163#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
164#[serde(rename_all = "camelCase")]
165pub struct StartSamplingReturnObject {}
166#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
167#[serde(rename_all = "camelCase")]
168pub struct StartTrackingHeapObjectsReturnObject {}
169#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
170pub struct StopSamplingReturnObject {
171 #[serde(rename = "profile")]
172 pub profile: SamplingHeapProfile,
173}
174#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
175#[serde(rename_all = "camelCase")]
176pub struct StopTrackingHeapObjectsReturnObject {}
177#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
178#[serde(rename_all = "camelCase")]
179pub struct TakeHeapSnapshotReturnObject {}
180impl Method for AddInspectedHeapObject {
181 const NAME: &'static str = "HeapProfiler.addInspectedHeapObject";
182 type ReturnObject = AddInspectedHeapObjectReturnObject;
183}
184impl Method for CollectGarbage {
185 const NAME: &'static str = "HeapProfiler.collectGarbage";
186 type ReturnObject = CollectGarbageReturnObject;
187}
188impl Method for Disable {
189 const NAME: &'static str = "HeapProfiler.disable";
190 type ReturnObject = DisableReturnObject;
191}
192impl Method for Enable {
193 const NAME: &'static str = "HeapProfiler.enable";
194 type ReturnObject = EnableReturnObject;
195}
196impl Method for GetHeapObjectId {
197 const NAME: &'static str = "HeapProfiler.getHeapObjectId";
198 type ReturnObject = GetHeapObjectIdReturnObject;
199}
200impl Method for GetObjectByHeapObjectId {
201 const NAME: &'static str = "HeapProfiler.getObjectByHeapObjectId";
202 type ReturnObject = GetObjectByHeapObjectIdReturnObject;
203}
204impl Method for GetSamplingProfile {
205 const NAME: &'static str = "HeapProfiler.getSamplingProfile";
206 type ReturnObject = GetSamplingProfileReturnObject;
207}
208impl Method for StartSampling {
209 const NAME: &'static str = "HeapProfiler.startSampling";
210 type ReturnObject = StartSamplingReturnObject;
211}
212impl Method for StartTrackingHeapObjects {
213 const NAME: &'static str = "HeapProfiler.startTrackingHeapObjects";
214 type ReturnObject = StartTrackingHeapObjectsReturnObject;
215}
216impl Method for StopSampling {
217 const NAME: &'static str = "HeapProfiler.stopSampling";
218 type ReturnObject = StopSamplingReturnObject;
219}
220impl Method for StopTrackingHeapObjects {
221 const NAME: &'static str = "HeapProfiler.stopTrackingHeapObjects";
222 type ReturnObject = StopTrackingHeapObjectsReturnObject;
223}
224impl Method for TakeHeapSnapshot {
225 const NAME: &'static str = "HeapProfiler.takeHeapSnapshot";
226 type ReturnObject = TakeHeapSnapshotReturnObject;
227}
228pub mod events {
229 #[allow(unused_imports)]
230 use super::super::types::*;
231 #[allow(unused_imports)]
232 use serde::{Deserialize, Serialize};
233 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
234 pub struct AddHeapSnapshotChunkEvent {
235 pub params: AddHeapSnapshotChunkEventParams,
236 }
237 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
238 pub struct AddHeapSnapshotChunkEventParams {
239 #[serde(default)]
240 #[serde(rename = "chunk")]
241 pub chunk: String,
242 }
243 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
244 pub struct HeapStatsUpdateEvent {
245 pub params: HeapStatsUpdateEventParams,
246 }
247 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
248 pub struct HeapStatsUpdateEventParams {
249 #[serde(default)]
250 #[serde(rename = "statsUpdate")]
251 pub stats_update: Vec<JsUInt>,
252 }
253 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
254 pub struct LastSeenObjectIdEvent {
255 pub params: LastSeenObjectIdEventParams,
256 }
257 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
258 pub struct LastSeenObjectIdEventParams {
259 #[serde(default)]
260 #[serde(rename = "lastSeenObjectId")]
261 pub last_seen_object_id: JsUInt,
262 #[serde(default)]
263 #[serde(rename = "timestamp")]
264 pub timestamp: JsFloat,
265 }
266 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
267 pub struct ReportHeapSnapshotProgressEvent {
268 pub params: ReportHeapSnapshotProgressEventParams,
269 }
270 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
271 pub struct ReportHeapSnapshotProgressEventParams {
272 #[serde(default)]
273 #[serde(rename = "done")]
274 pub done: JsUInt,
275 #[serde(default)]
276 #[serde(rename = "total")]
277 pub total: JsUInt,
278 #[serde(skip_serializing_if = "Option::is_none")]
279 #[serde(default)]
280 #[serde(rename = "finished")]
281 pub finished: Option<bool>,
282 }
283 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
284 #[serde(rename_all = "camelCase")]
285 pub struct ResetProfilesEvent(pub Option<serde_json::Value>);
286}