From 015f77a7883b253a501fe3f17ddc613943c28276 Mon Sep 17 00:00:00 2001 From: Chris H-C Date: Tue, 7 Jan 2025 10:12:31 -0500 Subject: [PATCH] bug 1937610 - Firefox Desktop JS docs for (Labeled) Timing Distribution accumulate(Single)Sample(s) --- .../metrics/labeled_timing_distributions.md | 8 ++++++-- docs/user/reference/metrics/timing_distribution.md | 14 +++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/docs/user/reference/metrics/labeled_timing_distributions.md b/docs/user/reference/metrics/labeled_timing_distributions.md index 04485dc387..6840ae17a1 100644 --- a/docs/user/reference/metrics/labeled_timing_distributions.md +++ b/docs/user/reference/metrics/labeled_timing_distributions.md @@ -208,7 +208,9 @@ mozilla::glean::devtools::cold_toolbox_open_delay **JavaScript** -This operation is not currently supported in JavaScript. +```js +Glean.devtools.coldToolboxOpenDelay[toolboxId].accumulateSamples(samples); +``` @@ -269,7 +271,9 @@ mozilla::glean::devtools::cold_toolbox_open_delay **JavaScript** -This operation is not currently supported in JavaScript. +```js +Glean.devtools.coldToolboxOpenDelay[toolboxId].accumulateSamples(sample); +``` diff --git a/docs/user/reference/metrics/timing_distribution.md b/docs/user/reference/metrics/timing_distribution.md index 8cf5cb3364..5a2b13c6e2 100644 --- a/docs/user/reference/metrics/timing_distribution.md +++ b/docs/user/reference/metrics/timing_distribution.md @@ -318,12 +318,14 @@ function onPageLoaded() { ```c++ #include "mozilla/glean/GleanMetrics.h" -mozilla::glean::pages::page_load.AccumulateRawSamples(sample); +mozilla::glean::pages::page_load.AccumulateRawSamples(samples); ``` **JavaScript** -This operation is not currently supported in JavaScript. +```js +Glean.pages.pageLoad.accumulateSamples(samples); +``` @@ -335,8 +337,8 @@ Accumulates a single signed sample and appends it to the metric. Prefer this for the common use case of having a single value to avoid having to pass a collection over a foreign language interface. -A signed value is required so that the platform-specific code can provide -us with a 64 bit signed integer if no `u64` comparable type is available. +A signed value is required so that the platform-specific code can provide +us with a 64 bit signed integer if no `u64` comparable type is available. This will take care of filtering and reporting errors for a negative sample. @@ -416,7 +418,9 @@ mozilla::glean::pages::page_load.AccumulateRawDuration(aDuration); **JavaScript** -This operation is not currently supported in JavaScript. +```js +Glean.pages.pageLoad.accumulateSingleSample(sample); +```