use serde::{Deserialize, Serialize};
pub type HeapSnapshotObjectId = String;
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SamplingHeapProfileNode {
#[serde(rename = "callFrame")]
pub call_frame: crate::protocol::runtime::CallFrame,
#[serde(rename = "selfSize")]
pub self_size: f64,
pub id: i64,
pub children: Vec<SamplingHeapProfileNode>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SamplingHeapProfileSample {
pub size: f64,
#[serde(rename = "nodeId")]
pub node_id: i64,
pub ordinal: f64,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct SamplingHeapProfile {
pub head: SamplingHeapProfileNode,
pub samples: Vec<SamplingHeapProfileSample>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct AddInspectedHeapObjectParams {
#[serde(rename = "heapObjectId")]
pub heap_object_id: HeapSnapshotObjectId,
}
impl crate::typed::Command for AddInspectedHeapObjectParams {
const METHOD: &'static str = "HeapProfiler.addInspectedHeapObject";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct CollectGarbageParams {}
impl crate::typed::Command for CollectGarbageParams {
const METHOD: &'static str = "HeapProfiler.collectGarbage";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct DisableParams {}
impl crate::typed::Command for DisableParams {
const METHOD: &'static str = "HeapProfiler.disable";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct EnableParams {}
impl crate::typed::Command for EnableParams {
const METHOD: &'static str = "HeapProfiler.enable";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetHeapObjectIdParams {
#[serde(rename = "objectId")]
pub object_id: crate::protocol::runtime::RemoteObjectId,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetHeapObjectIdReturns {
#[serde(rename = "heapSnapshotObjectId")]
pub heap_snapshot_object_id: HeapSnapshotObjectId,
}
impl crate::typed::Command for GetHeapObjectIdParams {
const METHOD: &'static str = "HeapProfiler.getHeapObjectId";
type Returns = GetHeapObjectIdReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetObjectByHeapObjectIdParams {
#[serde(rename = "objectId")]
pub object_id: HeapSnapshotObjectId,
#[serde(
rename = "objectGroup",
default,
skip_serializing_if = "Option::is_none"
)]
pub object_group: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GetObjectByHeapObjectIdReturns {
pub result: crate::protocol::runtime::RemoteObject,
}
impl crate::typed::Command for GetObjectByHeapObjectIdParams {
const METHOD: &'static str = "HeapProfiler.getObjectByHeapObjectId";
type Returns = GetObjectByHeapObjectIdReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetSamplingProfileParams {}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct GetSamplingProfileReturns {
pub profile: SamplingHeapProfile,
}
impl crate::typed::Command for GetSamplingProfileParams {
const METHOD: &'static str = "HeapProfiler.getSamplingProfile";
type Returns = GetSamplingProfileReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StartSamplingParams {
#[serde(
rename = "samplingInterval",
default,
skip_serializing_if = "Option::is_none"
)]
pub sampling_interval: Option<f64>,
#[serde(
rename = "stackDepth",
default,
skip_serializing_if = "Option::is_none"
)]
pub stack_depth: Option<f64>,
#[serde(
rename = "includeObjectsCollectedByMajorGC",
default,
skip_serializing_if = "Option::is_none"
)]
pub include_objects_collected_by_major_gc: Option<bool>,
#[serde(
rename = "includeObjectsCollectedByMinorGC",
default,
skip_serializing_if = "Option::is_none"
)]
pub include_objects_collected_by_minor_gc: Option<bool>,
}
impl crate::typed::Command for StartSamplingParams {
const METHOD: &'static str = "HeapProfiler.startSampling";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StartTrackingHeapObjectsParams {
#[serde(
rename = "trackAllocations",
default,
skip_serializing_if = "Option::is_none"
)]
pub track_allocations: Option<bool>,
}
impl crate::typed::Command for StartTrackingHeapObjectsParams {
const METHOD: &'static str = "HeapProfiler.startTrackingHeapObjects";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StopSamplingParams {}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StopSamplingReturns {
pub profile: SamplingHeapProfile,
}
impl crate::typed::Command for StopSamplingParams {
const METHOD: &'static str = "HeapProfiler.stopSampling";
type Returns = StopSamplingReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct StopTrackingHeapObjectsParams {
#[serde(
rename = "reportProgress",
default,
skip_serializing_if = "Option::is_none"
)]
pub report_progress: Option<bool>,
#[serde(
rename = "treatGlobalObjectsAsRoots",
default,
skip_serializing_if = "Option::is_none"
)]
pub treat_global_objects_as_roots: Option<bool>,
#[serde(
rename = "captureNumericValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub capture_numeric_value: Option<bool>,
#[serde(
rename = "exposeInternals",
default,
skip_serializing_if = "Option::is_none"
)]
pub expose_internals: Option<bool>,
}
impl crate::typed::Command for StopTrackingHeapObjectsParams {
const METHOD: &'static str = "HeapProfiler.stopTrackingHeapObjects";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct TakeHeapSnapshotParams {
#[serde(
rename = "reportProgress",
default,
skip_serializing_if = "Option::is_none"
)]
pub report_progress: Option<bool>,
#[serde(
rename = "treatGlobalObjectsAsRoots",
default,
skip_serializing_if = "Option::is_none"
)]
pub treat_global_objects_as_roots: Option<bool>,
#[serde(
rename = "captureNumericValue",
default,
skip_serializing_if = "Option::is_none"
)]
pub capture_numeric_value: Option<bool>,
#[serde(
rename = "exposeInternals",
default,
skip_serializing_if = "Option::is_none"
)]
pub expose_internals: Option<bool>,
}
impl crate::typed::Command for TakeHeapSnapshotParams {
const METHOD: &'static str = "HeapProfiler.takeHeapSnapshot";
type Returns = crate::typed::NoReturns;
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct AddHeapSnapshotChunkEvent {
pub chunk: String,
}
impl crate::typed::Event for AddHeapSnapshotChunkEvent {
const METHOD: &'static str = "HeapProfiler.addHeapSnapshotChunk";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct HeapStatsUpdateEvent {
#[serde(rename = "statsUpdate")]
pub stats_update: Vec<i64>,
}
impl crate::typed::Event for HeapStatsUpdateEvent {
const METHOD: &'static str = "HeapProfiler.heapStatsUpdate";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct LastSeenObjectIdEvent {
#[serde(rename = "lastSeenObjectId")]
pub last_seen_object_id: i64,
pub timestamp: f64,
}
impl crate::typed::Event for LastSeenObjectIdEvent {
const METHOD: &'static str = "HeapProfiler.lastSeenObjectId";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ReportHeapSnapshotProgressEvent {
pub done: i64,
pub total: i64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub finished: Option<bool>,
}
impl crate::typed::Event for ReportHeapSnapshotProgressEvent {
const METHOD: &'static str = "HeapProfiler.reportHeapSnapshotProgress";
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ResetProfilesEvent {}
impl crate::typed::Event for ResetProfilesEvent {
const METHOD: &'static str = "HeapProfiler.resetProfiles";
}