aboutsummaryrefslogtreecommitdiffstats
path: root/components/metrics
diff options
context:
space:
mode:
authorddh <dianehosfelt@gmail.com>2017-11-14 15:08:32 +0000
committerddh <dianehosfelt@gmail.com>2017-11-14 15:21:35 +0000
commit2ef28d05b58b3184773c4bcd2b41601dcb69da8e (patch)
tree2707901d2f77b49035233ef5fe854e377801e892 /components/metrics
parentd287ec8d3ee5af9e64979ec77894f218cae1b46d (diff)
downloadservo-2ef28d05b58b3184773c4bcd2b41601dcb69da8e.tar.gz
servo-2ef28d05b58b3184773c4bcd2b41601dcb69da8e.zip
added navigation start for interactive metrics
Diffstat (limited to 'components/metrics')
-rw-r--r--components/metrics/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/metrics/lib.rs b/components/metrics/lib.rs
index 7e7cd9afd1d..bd2d488f100 100644
--- a/components/metrics/lib.rs
+++ b/components/metrics/lib.rs
@@ -40,6 +40,7 @@ pub trait ProgressiveWebMetric {
fn send_queued_constellation_msg(&self, name: ProgressiveWebMetricType, time: u64);
}
+/// TODO make this configurable
/// maximum task time is 50ms (in ns)
pub const MAX_TASK_NS: u64 = 50000000;
/// 10 second window (in ns)
@@ -84,6 +85,7 @@ fn set_metric<U: ProgressiveWebMetric>(
// Print the metric to console if the print-pwm option was given.
if opts::get().print_pwm {
+ println!("Navigation start: {}", pwm.get_navigation_start().unwrap());
println!("{:?} {:?}", metric_type, time);
}
@@ -216,6 +218,10 @@ impl InteractiveMetrics {
pub fn get_tti(&self) -> Option<u64> {
self.time_to_interactive.get()
}
+
+ pub fn needs_tti(&self) -> bool {
+ self.get_tti().is_none()
+ }
}
impl ProgressiveWebMetric for InteractiveMetrics {