browser_protocol/performance/
mod.rs1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
7#[serde(rename_all = "camelCase")]
8pub struct Metric {
9 pub name: String,
12 pub value: f64,
15}
16
17#[derive(Debug, Clone, Serialize, Deserialize, Default)]
18pub struct DisableParams {}
19
20impl DisableParams { pub const METHOD: &'static str = "Performance.disable"; }
21
22impl crate::CdpCommand for DisableParams {
23 const METHOD: &'static str = "Performance.disable";
24 type Response = crate::EmptyReturns;
25}
26
27#[derive(Debug, Clone, Serialize, Deserialize, Default)]
30#[serde(rename_all = "camelCase")]
31pub struct EnableParams {
32 #[serde(skip_serializing_if = "Option::is_none")]
35 pub timeDomain: Option<String>,
36}
37
38impl EnableParams { pub const METHOD: &'static str = "Performance.enable"; }
39
40impl crate::CdpCommand for EnableParams {
41 const METHOD: &'static str = "Performance.enable";
42 type Response = crate::EmptyReturns;
43}
44
45#[derive(Debug, Clone, Serialize, Deserialize, Default)]
50#[serde(rename_all = "camelCase")]
51pub struct SetTimeDomainParams {
52 pub timeDomain: String,
55}
56
57impl SetTimeDomainParams { pub const METHOD: &'static str = "Performance.setTimeDomain"; }
58
59impl crate::CdpCommand for SetTimeDomainParams {
60 const METHOD: &'static str = "Performance.setTimeDomain";
61 type Response = crate::EmptyReturns;
62}
63
64#[derive(Debug, Clone, Serialize, Deserialize, Default)]
67#[serde(rename_all = "camelCase")]
68pub struct GetMetricsReturns {
69 pub metrics: Vec<Metric>,
72}
73
74#[derive(Debug, Clone, Serialize, Deserialize, Default)]
75pub struct GetMetricsParams {}
76
77impl GetMetricsParams { pub const METHOD: &'static str = "Performance.getMetrics"; }
78
79impl crate::CdpCommand for GetMetricsParams {
80 const METHOD: &'static str = "Performance.getMetrics";
81 type Response = GetMetricsReturns;
82}