aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDelan Azabani <dazabani@igalia.com>2024-11-25 16:29:37 +0800
committerGitHub <noreply@github.com>2024-11-25 08:29:37 +0000
commit0d91da610a73b7abeb76f2d1d49a23c9ca3e704d (patch)
tree8bc027d4aeedd695d13f4143d47006b2cf26484c
parentcb212633b63e238e400ec5110475693478924eb3 (diff)
downloadservo-0d91da610a73b7abeb76f2d1d49a23c9ca3e704d.tar.gz
servo-0d91da610a73b7abeb76f2d1d49a23c9ca3e704d.zip
[NFC] Remove unused metrics code (#34370)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
-rw-r--r--components/metrics/lib.rs28
1 files changed, 4 insertions, 24 deletions
diff --git a/components/metrics/lib.rs b/components/metrics/lib.rs
index 3186e35c216..0ac3021c52b 100644
--- a/components/metrics/lib.rs
+++ b/components/metrics/lib.rs
@@ -56,10 +56,9 @@ fn set_metric<U: ProgressiveWebMetric>(
metric_type: ProgressiveWebMetricType,
category: ProfilerCategory,
attr: &Cell<Option<CrossProcessInstant>>,
- metric_time: Option<CrossProcessInstant>,
+ metric_time: CrossProcessInstant,
url: &ServoUrl,
) {
- let metric_time = metric_time.unwrap_or_else(CrossProcessInstant::now);
attr.set(Some(metric_time));
// Queue performance observer notification.
@@ -211,7 +210,7 @@ impl InteractiveMetrics {
ProgressiveWebMetricType::TimeToInteractive,
ProfilerCategory::TimeToInteractive,
&self.time_to_interactive,
- Some(metric_time),
+ metric_time,
&self.url,
);
}
@@ -285,25 +284,6 @@ impl PaintTimeMetrics {
}
}
- pub fn maybe_set_first_paint<T>(&self, profiler_metadata_factory: &T)
- where
- T: ProfilerMetadataFactory,
- {
- if self.first_paint.get().is_some() {
- return;
- }
-
- set_metric(
- self,
- profiler_metadata_factory.new_metadata(),
- ProgressiveWebMetricType::FirstPaint,
- ProfilerCategory::TimeToFirstPaint,
- &self.first_paint,
- None,
- &self.url,
- );
- }
-
pub fn maybe_observe_paint_time<T>(
&self,
profiler_metadata_factory: &T,
@@ -348,7 +328,7 @@ impl PaintTimeMetrics {
ProgressiveWebMetricType::FirstPaint,
ProfilerCategory::TimeToFirstPaint,
&self.first_paint,
- Some(paint_time),
+ paint_time,
&self.url,
);
@@ -359,7 +339,7 @@ impl PaintTimeMetrics {
ProgressiveWebMetricType::FirstContentfulPaint,
ProfilerCategory::TimeToFirstContentfulPaint,
&self.first_contentful_paint,
- Some(paint_time),
+ paint_time,
&self.url,
);
}