.accumulateSingleSample on a labeled timing distribution metric doesn't mirror the data through GIFFT
Categories
(Toolkit :: Telemetry, defect, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox138 | --- | fixed |
People
(Reporter: florian, Assigned: chutten)
References
Details
Attachments
(1 file)
My patches in bug 1953106 cause a test failure in toolkit/components/extensions/test/xpcshell/test_ext_eventpage_idle.js
.
This change makes the test pass:
diff --git a/toolkit/components/glean/api/src/private/labeled_timing_distribution.rs b/toolkit/components/glean/api/src/private/labeled_timing_distribution.rs
--- a/toolkit/components/glean/api/src/private/labeled_timing_distribution.rs
+++ b/toolkit/components/glean/api/src/private/labeled_timing_distribution.rs
@@ -234,6 +234,25 @@ impl TimingDistribution for LabeledTimin
}
pub fn accumulate_single_sample(&self, sample: i64) {
+ extern "C" {
+ fn GIFFT_LabeledTimingDistributionAccumulateRawMillis(
+ metric_id: u32,
+ label: &nsACString,
+ sample_ms: u32,
+ );
+ }
+ let id = &self
+ .id
+ .metric_id()
+ .expect("Cannot perform GIFFT calls without a MetricId");
+ // SAFETY: We're only loaning to C++ data we don't later use.
+ unsafe {
+ GIFFT_LabeledTimingDistributionAccumulateRawMillis(
+ id.0,
+ &nsCString::from(&self.label),
+ sample.try_into().unwrap(),
+ );
+ }
#[cfg(feature = "with_gecko")]
if gecko_profiler::can_accept_markers() {
gecko_profiler::add_marker(
Assignee | ||
Comment 1•1 month ago
|
||
From bug 1941760 comment #4:
So we're clear to have GIFFT convert samples to time_unit units on mirror for timing_distribution metrics, but converting to millis for labeled_timing_distribution metrics if we want to go that route.
Not entirely certain why I didn't include this in the patch.
Assignee | ||
Comment 2•1 month ago
|
||
It's not consistent with the non-labeled case which converts to time_unit units
because labeled_timing_distribution doesn't know them.
But it's no more inconsistent than before, and unblocks further FOG Migration.
Hopefully in bug 1943453 we'll figure out a way to get around the weirdness.
And all else fails, Legacy Telemetry is set to be removed (along with GIFFT)
in the medium term.
Comment 4•1 month ago
|
||
Assignee | ||
Comment 5•1 month ago
|
||
Ack, need some #[cfg(feature = "with_gecko")]
in here.
Comment 7•1 month ago
|
||
bugherder |
Description
•