use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Metric {
pub name: String,
pub value: f64,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "Performance.disable"; }
impl crate::CdpCommand for DisableParams {
const METHOD: &'static str = "Performance.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct EnableParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub timeDomain: Option<String>,
}
impl EnableParams { pub const METHOD: &'static str = "Performance.enable"; }
impl crate::CdpCommand for EnableParams {
const METHOD: &'static str = "Performance.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct SetTimeDomainParams {
pub timeDomain: String,
}
impl SetTimeDomainParams { pub const METHOD: &'static str = "Performance.setTimeDomain"; }
impl crate::CdpCommand for SetTimeDomainParams {
const METHOD: &'static str = "Performance.setTimeDomain";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetMetricsReturns {
pub metrics: Vec<Metric>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct GetMetricsParams {}
impl GetMetricsParams { pub const METHOD: &'static str = "Performance.getMetrics"; }
impl crate::CdpCommand for GetMetricsParams {
const METHOD: &'static str = "Performance.getMetrics";
type Response = GetMetricsReturns;
}