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 = "stackDepth")]
82 pub stack_depth: Option<JsFloat>,
83 #[serde(skip_serializing_if = "Option::is_none")]
84 #[serde(default)]
85 #[serde(rename = "includeObjectsCollectedByMajorGC")]
86 pub include_objects_collected_by_major_gc: Option<bool>,
87 #[serde(skip_serializing_if = "Option::is_none")]
88 #[serde(default)]
89 #[serde(rename = "includeObjectsCollectedByMinorGC")]
90 pub include_objects_collected_by_minor_gc: Option<bool>,
91}
92#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
93pub struct StartTrackingHeapObjects {
94 #[serde(skip_serializing_if = "Option::is_none")]
95 #[serde(default)]
96 #[serde(rename = "trackAllocations")]
97 pub track_allocations: Option<bool>,
98}
99#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
100#[serde(rename_all = "camelCase")]
101pub struct StopSampling(pub Option<serde_json::Value>);
102#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
103pub struct StopTrackingHeapObjects {
104 #[serde(skip_serializing_if = "Option::is_none")]
105 #[serde(default)]
106 #[serde(rename = "reportProgress")]
107 pub report_progress: Option<bool>,
108 #[serde(skip_serializing_if = "Option::is_none")]
109 #[serde(default)]
110 #[serde(rename = "treatGlobalObjectsAsRoots")]
111 pub treat_global_objects_as_roots: Option<bool>,
112 #[serde(skip_serializing_if = "Option::is_none")]
113 #[serde(default)]
114 #[serde(rename = "captureNumericValue")]
115 pub capture_numeric_value: Option<bool>,
116 #[serde(skip_serializing_if = "Option::is_none")]
117 #[serde(default)]
118 #[serde(rename = "exposeInternals")]
119 pub expose_internals: Option<bool>,
120}
121#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
122pub struct TakeHeapSnapshot {
123 #[serde(skip_serializing_if = "Option::is_none")]
124 #[serde(default)]
125 #[serde(rename = "reportProgress")]
126 pub report_progress: Option<bool>,
127 #[serde(skip_serializing_if = "Option::is_none")]
128 #[serde(default)]
129 #[serde(rename = "treatGlobalObjectsAsRoots")]
130 pub treat_global_objects_as_roots: Option<bool>,
131 #[serde(skip_serializing_if = "Option::is_none")]
132 #[serde(default)]
133 #[serde(rename = "captureNumericValue")]
134 pub capture_numeric_value: Option<bool>,
135 #[serde(skip_serializing_if = "Option::is_none")]
136 #[serde(default)]
137 #[serde(rename = "exposeInternals")]
138 pub expose_internals: Option<bool>,
139}
140#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
141#[serde(rename_all = "camelCase")]
142pub struct AddInspectedHeapObjectReturnObject {}
143#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
144#[serde(rename_all = "camelCase")]
145pub struct CollectGarbageReturnObject {}
146#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
147#[serde(rename_all = "camelCase")]
148pub struct DisableReturnObject {}
149#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
150#[serde(rename_all = "camelCase")]
151pub struct EnableReturnObject {}
152#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
153pub struct GetHeapObjectIdReturnObject {
154 #[serde(rename = "heapSnapshotObjectId")]
155 pub heap_snapshot_object_id: HeapSnapshotObjectId,
156}
157#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
158pub struct GetObjectByHeapObjectIdReturnObject {
159 #[serde(rename = "result")]
160 pub result: runtime::RemoteObject,
161}
162#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
163pub struct GetSamplingProfileReturnObject {
164 #[serde(rename = "profile")]
165 pub profile: SamplingHeapProfile,
166}
167#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
168#[serde(rename_all = "camelCase")]
169pub struct StartSamplingReturnObject {}
170#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
171#[serde(rename_all = "camelCase")]
172pub struct StartTrackingHeapObjectsReturnObject {}
173#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
174pub struct StopSamplingReturnObject {
175 #[serde(rename = "profile")]
176 pub profile: SamplingHeapProfile,
177}
178#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
179#[serde(rename_all = "camelCase")]
180pub struct StopTrackingHeapObjectsReturnObject {}
181#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
182#[serde(rename_all = "camelCase")]
183pub struct TakeHeapSnapshotReturnObject {}
184impl Method for AddInspectedHeapObject {
185 const NAME: &'static str = "HeapProfiler.addInspectedHeapObject";
186 type ReturnObject = AddInspectedHeapObjectReturnObject;
187}
188impl Method for CollectGarbage {
189 const NAME: &'static str = "HeapProfiler.collectGarbage";
190 type ReturnObject = CollectGarbageReturnObject;
191}
192impl Method for Disable {
193 const NAME: &'static str = "HeapProfiler.disable";
194 type ReturnObject = DisableReturnObject;
195}
196impl Method for Enable {
197 const NAME: &'static str = "HeapProfiler.enable";
198 type ReturnObject = EnableReturnObject;
199}
200impl Method for GetHeapObjectId {
201 const NAME: &'static str = "HeapProfiler.getHeapObjectId";
202 type ReturnObject = GetHeapObjectIdReturnObject;
203}
204impl Method for GetObjectByHeapObjectId {
205 const NAME: &'static str = "HeapProfiler.getObjectByHeapObjectId";
206 type ReturnObject = GetObjectByHeapObjectIdReturnObject;
207}
208impl Method for GetSamplingProfile {
209 const NAME: &'static str = "HeapProfiler.getSamplingProfile";
210 type ReturnObject = GetSamplingProfileReturnObject;
211}
212impl Method for StartSampling {
213 const NAME: &'static str = "HeapProfiler.startSampling";
214 type ReturnObject = StartSamplingReturnObject;
215}
216impl Method for StartTrackingHeapObjects {
217 const NAME: &'static str = "HeapProfiler.startTrackingHeapObjects";
218 type ReturnObject = StartTrackingHeapObjectsReturnObject;
219}
220impl Method for StopSampling {
221 const NAME: &'static str = "HeapProfiler.stopSampling";
222 type ReturnObject = StopSamplingReturnObject;
223}
224impl Method for StopTrackingHeapObjects {
225 const NAME: &'static str = "HeapProfiler.stopTrackingHeapObjects";
226 type ReturnObject = StopTrackingHeapObjectsReturnObject;
227}
228impl Method for TakeHeapSnapshot {
229 const NAME: &'static str = "HeapProfiler.takeHeapSnapshot";
230 type ReturnObject = TakeHeapSnapshotReturnObject;
231}
232pub mod events {
233 #[allow(unused_imports)]
234 use super::super::types::*;
235 #[allow(unused_imports)]
236 use serde::{Deserialize, Serialize};
237 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
238 pub struct AddHeapSnapshotChunkEvent {
239 pub params: AddHeapSnapshotChunkEventParams,
240 }
241 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
242 pub struct AddHeapSnapshotChunkEventParams {
243 #[serde(default)]
244 #[serde(rename = "chunk")]
245 pub chunk: String,
246 }
247 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
248 pub struct HeapStatsUpdateEvent {
249 pub params: HeapStatsUpdateEventParams,
250 }
251 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
252 pub struct HeapStatsUpdateEventParams {
253 #[serde(default)]
254 #[serde(rename = "statsUpdate")]
255 pub stats_update: Vec<JsUInt>,
256 }
257 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
258 pub struct LastSeenObjectIdEvent {
259 pub params: LastSeenObjectIdEventParams,
260 }
261 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
262 pub struct LastSeenObjectIdEventParams {
263 #[serde(default)]
264 #[serde(rename = "lastSeenObjectId")]
265 pub last_seen_object_id: JsUInt,
266 #[serde(default)]
267 #[serde(rename = "timestamp")]
268 pub timestamp: JsFloat,
269 }
270 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
271 pub struct ReportHeapSnapshotProgressEvent {
272 pub params: ReportHeapSnapshotProgressEventParams,
273 }
274 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
275 pub struct ReportHeapSnapshotProgressEventParams {
276 #[serde(default)]
277 #[serde(rename = "done")]
278 pub done: JsUInt,
279 #[serde(default)]
280 #[serde(rename = "total")]
281 pub total: JsUInt,
282 #[serde(skip_serializing_if = "Option::is_none")]
283 #[serde(default)]
284 #[serde(rename = "finished")]
285 pub finished: Option<bool>,
286 }
287 #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)]
288 #[serde(rename_all = "camelCase")]
289 pub struct ResetProfilesEvent(pub Option<serde_json::Value>);
290}