rustenium_cdp_definitions/js_protocol/profiler/
events.rs1use serde::{Deserialize, Serialize};
2#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3pub struct ConsoleProfileFinishedParams {
4 #[serde(rename = "id")]
5 pub id: String,
6 #[doc = "Location of console.profileEnd()."]
7 #[serde(rename = "location")]
8 pub location: crate::js_protocol::debugger::types::Location,
9 #[serde(rename = "profile")]
10 pub profile: super::types::Profile,
11 #[doc = "Profile title passed as an argument to console.profile()."]
12 #[serde(rename = "title")]
13 #[serde(skip_serializing_if = "Option::is_none")]
14 #[serde(default)]
15 pub title: Option<String>,
16}
17#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
18pub enum ConsoleProfileFinishedMethod {
19 #[serde(rename = "Profiler.consoleProfileFinished")]
20 ConsoleProfileFinished,
21}
22#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
23pub struct ConsoleProfileFinished {
24 pub method: ConsoleProfileFinishedMethod,
25 pub params: ConsoleProfileFinishedParams,
26}
27impl ConsoleProfileFinished {
28 pub const IDENTIFIER: &'static str = "Profiler.consoleProfileFinished";
29 pub fn identifier(&self) -> &'static str {
30 Self::IDENTIFIER
31 }
32}
33#[doc = "Sent when new profile recording is started using console.profile() call.\n[consoleProfileStarted](https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#event-consoleProfileStarted)"]
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct ConsoleProfileStartedParams {
36 #[serde(rename = "id")]
37 pub id: String,
38 #[doc = "Location of console.profile()."]
39 #[serde(rename = "location")]
40 pub location: crate::js_protocol::debugger::types::Location,
41 #[doc = "Profile title passed as an argument to console.profile()."]
42 #[serde(rename = "title")]
43 #[serde(skip_serializing_if = "Option::is_none")]
44 #[serde(default)]
45 pub title: Option<String>,
46}
47#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
48pub enum ConsoleProfileStartedMethod {
49 #[serde(rename = "Profiler.consoleProfileStarted")]
50 ConsoleProfileStarted,
51}
52#[doc = "Sent when new profile recording is started using console.profile() call.\n[consoleProfileStarted](https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#event-consoleProfileStarted)"]
53#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
54pub struct ConsoleProfileStarted {
55 pub method: ConsoleProfileStartedMethod,
56 pub params: ConsoleProfileStartedParams,
57}
58impl ConsoleProfileStarted {
59 pub const IDENTIFIER: &'static str = "Profiler.consoleProfileStarted";
60 pub fn identifier(&self) -> &'static str {
61 Self::IDENTIFIER
62 }
63}
64#[doc = "Reports coverage delta since the last poll (either from an event like this, or from\n`takePreciseCoverage` for the current isolate. May only be sent if precise code\ncoverage has been started. This event can be trigged by the embedder to, for example,\ntrigger collection of coverage data immediately at a certain point in time.\n[preciseCoverageDeltaUpdate](https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#event-preciseCoverageDeltaUpdate)"]
65#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
66pub struct PreciseCoverageDeltaUpdateParams {
67 #[doc = "Monotonically increasing time (in seconds) when the coverage update was taken in the backend."]
68 #[serde(rename = "timestamp")]
69 pub timestamp: f64,
70 #[doc = "Identifier for distinguishing coverage events."]
71 #[serde(rename = "occasion")]
72 pub occasion: String,
73 #[doc = "Coverage data for the current isolate."]
74 #[serde(rename = "result")]
75 #[serde(skip_serializing_if = "Vec::is_empty")]
76 pub result: Vec<super::types::ScriptCoverage>,
77}
78#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
79pub enum PreciseCoverageDeltaUpdateMethod {
80 #[serde(rename = "Profiler.preciseCoverageDeltaUpdate")]
81 PreciseCoverageDeltaUpdate,
82}
83#[doc = "Reports coverage delta since the last poll (either from an event like this, or from\n`takePreciseCoverage` for the current isolate. May only be sent if precise code\ncoverage has been started. This event can be trigged by the embedder to, for example,\ntrigger collection of coverage data immediately at a certain point in time.\n[preciseCoverageDeltaUpdate](https://chromedevtools.github.io/devtools-protocol/tot/Profiler/#event-preciseCoverageDeltaUpdate)"]
84#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
85pub struct PreciseCoverageDeltaUpdate {
86 pub method: PreciseCoverageDeltaUpdateMethod,
87 pub params: PreciseCoverageDeltaUpdateParams,
88}
89impl PreciseCoverageDeltaUpdate {
90 pub const IDENTIFIER: &'static str = "Profiler.preciseCoverageDeltaUpdate";
91 pub fn identifier(&self) -> &'static str {
92 Self::IDENTIFIER
93 }
94}
95group_enum ! (ProfilerEvents { ConsoleProfileFinished (ConsoleProfileFinished) , ConsoleProfileStarted (ConsoleProfileStarted) , PreciseCoverageDeltaUpdate (PreciseCoverageDeltaUpdate) } + identifiable);