added time to interactive metrics, refactored metrics to use traits

changed task macro to take pipeline info
This commit is contained in:
ddh 2017-10-02 14:52:39 +01:00
parent 347176df25
commit 2ffbe53989
26 changed files with 730 additions and 138 deletions

View file

@ -231,13 +231,15 @@ pub enum DocumentActivity {
FullyActive,
}
/// The type of recorded paint metric.
#[derive(Deserialize, Serialize)]
pub enum PaintMetricType {
/// Time to First Paint type.
/// Type of recorded progressive web metric
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
pub enum PWMType {
/// Time to first Paint
FirstPaint,
/// Time to First Contentful Paint type.
/// Time to first contentful paint
FirstContentfulPaint,
/// Time to interactive
TimeToInteractive,
}
/// The reason why the pipeline id of an iframe is being updated.
@ -322,7 +324,9 @@ pub enum ConstellationControlMsg {
/// Notifies the script thread of WebVR events.
WebVREvents(PipelineId, Vec<WebVREvent>),
/// Notifies the script thread about a new recorded paint metric.
PaintMetric(PipelineId, PaintMetricType, f64),
PaintMetric(PipelineId, PWMType, f64),
/// Notifies the script thread of interactive time
InteractiveMetric(PipelineId, f64),
}
impl fmt::Debug for ConstellationControlMsg {
@ -357,6 +361,7 @@ impl fmt::Debug for ConstellationControlMsg {
Reload(..) => "Reload",
WebVREvents(..) => "WebVREvents",
PaintMetric(..) => "PaintMetric",
InteractiveMetric(..) => "InteractiveMetric"
};
write!(formatter, "ConstellationMsg::{}", variant)
}