2023-09-19 20:39:09 +03:00
|
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2020-10-21 14:38:36 +03:00
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
2020-10-21 14:38:36 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
// The definitions in this file are not sorted.
|
|
|
|
|
// Please add new ones to the bottom.
|
2020-10-21 14:38:36 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
/**
|
|
|
|
|
* Base interface for all metric types to make typing more expressive.
|
|
|
|
|
*/
|
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanMetric {};
|
|
|
|
|
|
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanBoolean : GleanMetric {
|
2020-12-04 21:18:27 +03:00
|
|
|
|
/**
|
|
|
|
|
* Set to the specified boolean value.
|
|
|
|
|
*
|
|
|
|
|
* @param value the value to set.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined set(boolean value);
|
2020-12-04 21:18:27 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as a boolean.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2020-12-04 21:18:27 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
boolean? testGetValue(optional UTF8String aPingName = "");
|
2020-12-04 21:18:27 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanDatetime : GleanMetric {
|
2020-11-20 14:02:28 +03:00
|
|
|
|
/**
|
2020-11-21 00:39:36 +03:00
|
|
|
|
* Set the datetime to the provided value, or the local now.
|
2022-12-12 18:19:11 +03:00
|
|
|
|
* The internal value will store the local timezone.
|
2020-11-20 14:02:28 +03:00
|
|
|
|
*
|
2022-12-12 18:19:11 +03:00
|
|
|
|
* Note: The metric's time_unit affects the resolution of the value, not the
|
|
|
|
|
* unit of this function's parameter (which is always PRTime/nanos).
|
|
|
|
|
*
|
|
|
|
|
* @param aValue The (optional) time value as PRTime (nanoseconds since epoch).
|
|
|
|
|
* Defaults to local now.
|
2020-11-20 14:02:28 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined set(optional long long aValue);
|
2020-11-20 14:02:28 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Gets the currently stored value as a Date.
|
2020-11-20 14:02:28 +03:00
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2022-12-12 18:19:11 +03:00
|
|
|
|
* @return value of the stored metric as a JS Date with timezone,
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* or null if there is no value.
|
2020-11-20 14:02:28 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
any testGetValue(optional UTF8String aPingName = "");
|
2020-11-20 14:02:28 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanCounter : GleanMetric {
|
2020-10-21 14:38:36 +03:00
|
|
|
|
/*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Increases the counter by `amount`.
|
|
|
|
|
*
|
|
|
|
|
* @param aAmount The (optional) amount to increase by. Should be positive. Defaults to 1.
|
|
|
|
|
*/
|
|
|
|
|
undefined add(optional long aAmount = 1);
|
2020-10-21 14:38:36 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as an integer.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2020-10-21 14:38:36 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
long? testGetValue(optional UTF8String aPingName = "");
|
2020-10-21 14:38:36 +03:00
|
|
|
|
};
|
2020-10-21 14:09:26 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
dictionary GleanDistributionData {
|
|
|
|
|
required unsigned long long sum;
|
2024-03-06 16:10:38 +03:00
|
|
|
|
required unsigned long long count;
|
2023-09-19 20:39:09 +03:00
|
|
|
|
required record<UTF8String, unsigned long long> values;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanTimingDistribution : GleanMetric {
|
2021-01-15 23:26:59 +03:00
|
|
|
|
/**
|
|
|
|
|
* Starts tracking time for the provided metric.
|
|
|
|
|
*
|
|
|
|
|
* @returns A unique timer id for the new timer
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
unsigned long long start();
|
2021-01-15 23:26:59 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Stops tracking time for the provided metric and timer id.
|
|
|
|
|
*
|
|
|
|
|
* Adds a count to the corresponding bucket in the timing distribution.
|
|
|
|
|
* This will record an error if no `start` was called for this TimerId or
|
|
|
|
|
* if this TimerId was used to call `cancel`.
|
|
|
|
|
*
|
|
|
|
|
* @param aId The TimerId associated with this timing. This allows for
|
|
|
|
|
* concurrent timing of events associated with different ids.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined stopAndAccumulate(unsigned long long aId);
|
2021-01-15 23:26:59 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Aborts a previous `start` call. No error is recorded if no `start` was
|
|
|
|
|
* called. (But then where did you get that id from?)
|
|
|
|
|
*
|
|
|
|
|
* @param aId The TimerID whose `start` you wish to abort.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined cancel(unsigned long long aId);
|
2021-01-15 23:26:59 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Gets the currently stored value.
|
2021-01-15 23:26:59 +03:00
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-01-15 23:26:59 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
GleanDistributionData? testGetValue(optional UTF8String aPingName = "");
|
2022-03-31 23:17:03 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Accumulates a raw numeric sample of milliseconds.
|
|
|
|
|
*
|
|
|
|
|
* @param aSample The sample, in milliseconds, to add.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[ChromeOnly]
|
|
|
|
|
undefined testAccumulateRawMillis(unsigned long long aSample);
|
2021-01-15 23:26:59 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanMemoryDistribution : GleanMetric {
|
|
|
|
|
/**
|
|
|
|
|
* Accumulates the provided signed sample in the metric.
|
2020-12-14 20:17:45 +03:00
|
|
|
|
*
|
|
|
|
|
* @param aSample The sample to be recorded by the metric. The sample is
|
|
|
|
|
* assumed to be in the confgured memory unit of the metric.
|
|
|
|
|
*
|
|
|
|
|
* Notes: Values bigger than 1 Terabyte (2^40 bytes) are truncated and an
|
|
|
|
|
* InvalidValue error is recorded.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined accumulate(unsigned long long aSample);
|
2020-12-14 20:17:45 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as a DistributionData.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2020-12-14 20:17:45 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
GleanDistributionData? testGetValue(optional UTF8String aPingName = "");
|
2020-12-14 20:17:45 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanCustomDistribution : GleanMetric {
|
|
|
|
|
/**
|
2021-06-15 10:42:15 +03:00
|
|
|
|
* Accumulates the provided signed samples in the metric.
|
|
|
|
|
*
|
|
|
|
|
* @param aSamples - The vector holding the samples to be recorded by the metric.
|
|
|
|
|
*
|
|
|
|
|
* Notes: Discards any negative value in `samples`
|
|
|
|
|
* and report an `ErrorType::InvalidValue` for each of them.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined accumulateSamples(sequence<long long> aSamples);
|
2021-06-15 10:42:15 +03:00
|
|
|
|
|
2024-03-19 16:37:16 +03:00
|
|
|
|
/**
|
|
|
|
|
* Accumulates the provided single signed sample in the metric.
|
|
|
|
|
*
|
|
|
|
|
* @param aSample - The sample to be recorded by the metric.
|
|
|
|
|
*
|
|
|
|
|
* Notes: Discards any negative value of `sample` and reports an
|
|
|
|
|
* `ErrorType::InvalidValue`.
|
|
|
|
|
*/
|
|
|
|
|
undefined accumulateSingleSample(long long aSample);
|
|
|
|
|
|
2021-06-15 10:42:15 +03:00
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as a DistributionData.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-06-15 10:42:15 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
GleanDistributionData? testGetValue(optional UTF8String aPingName = "");
|
2021-04-20 18:42:06 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanString : GleanMetric {
|
2020-12-14 19:50:07 +03:00
|
|
|
|
/**
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Set the string to the provided value.
|
2020-12-14 19:50:07 +03:00
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @param aValue The string to set the metric to.
|
2021-04-20 18:42:06 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined set(UTF8String? aValue);
|
2020-11-06 19:39:39 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as a string.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2020-11-06 19:39:39 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
UTF8String? testGetValue(optional UTF8String aPingName = "");
|
2020-11-06 19:39:39 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanStringList : GleanMetric {
|
2021-01-05 18:03:08 +03:00
|
|
|
|
/**
|
|
|
|
|
* Adds a new string to the list.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Truncates the value and logs an error if it is longer than 100 bytes.
|
2021-01-05 18:03:08 +03:00
|
|
|
|
*
|
|
|
|
|
* @param value The string to add.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined add(UTF8String value);
|
2021-01-05 18:03:08 +03:00
|
|
|
|
|
|
|
|
|
/**
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Sets the string_list to the provided list of strings.
|
2021-01-05 18:03:08 +03:00
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Truncates the list and logs an error if longer than 100 items.
|
|
|
|
|
* Truncates any item longer than 100 bytes and logs an error.
|
2021-01-05 18:03:08 +03:00
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @param aValue The list of strings to set the metric to.
|
2021-01-05 18:03:08 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined set(sequence<UTF8String> aValue);
|
2021-01-05 18:03:08 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-01-05 18:03:08 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
sequence<UTF8String>? testGetValue(optional UTF8String aPingName = "");
|
2021-01-05 18:03:08 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanTimespan : GleanMetric {
|
2020-10-21 14:09:26 +03:00
|
|
|
|
/**
|
|
|
|
|
* Start tracking time for the provided metric.
|
|
|
|
|
*
|
|
|
|
|
* This records an error if it’s already tracking time (i.e. start was already
|
|
|
|
|
* called with no corresponding [stop]): in that case the original
|
|
|
|
|
* start time will be preserved.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined start();
|
2020-10-21 14:09:26 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Stop tracking time for the provided metric.
|
|
|
|
|
*
|
|
|
|
|
* Sets the metric to the elapsed time, but does not overwrite an already
|
|
|
|
|
* existing value.
|
|
|
|
|
* This will record an error if no [start] was called or there is an already
|
|
|
|
|
* existing value.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined stop();
|
2020-10-21 14:09:26 +03:00
|
|
|
|
|
2021-03-31 23:14:27 +03:00
|
|
|
|
/**
|
|
|
|
|
* Aborts a previous start.
|
|
|
|
|
*
|
|
|
|
|
* Does not record an error if there was no previous call to start.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined cancel();
|
2021-03-31 23:14:27 +03:00
|
|
|
|
|
2021-04-12 16:49:16 +03:00
|
|
|
|
/**
|
|
|
|
|
* Explicitly sets the timespan value.
|
|
|
|
|
*
|
|
|
|
|
* This API should only be used if you cannot make use of
|
|
|
|
|
* `start`/`stop`/`cancel`.
|
|
|
|
|
*
|
|
|
|
|
* @param aDuration The duration of this timespan, in units matching the
|
|
|
|
|
* `time_unit` of this metric's definition.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined setRaw(unsigned long aDuration);
|
2021-04-12 16:49:16 +03:00
|
|
|
|
|
2020-10-21 14:09:26 +03:00
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Gets the currently stored value.
|
2020-10-21 14:09:26 +03:00
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2020-10-21 14:09:26 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
unsigned long long? testGetValue(optional UTF8String aPingName = "");
|
2020-10-21 14:09:26 +03:00
|
|
|
|
};
|
2020-11-06 17:38:50 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanUuid : GleanMetric {
|
2020-11-06 17:38:50 +03:00
|
|
|
|
/**
|
|
|
|
|
* Set to the specified value.
|
|
|
|
|
*
|
|
|
|
|
* @param aValue The UUID to set the metric to.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined set(UTF8String aValue);
|
2020-11-06 17:38:50 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generate a new random UUID and set the metric to it.
|
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined generateAndSet();
|
2020-11-06 17:38:50 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Gets the currently stored value.
|
2020-11-06 17:38:50 +03:00
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2020-11-06 17:38:50 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
UTF8String? testGetValue(optional UTF8String aPingName = "");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dictionary GleanEventRecord {
|
|
|
|
|
required unsigned long long timestamp;
|
|
|
|
|
required UTF8String category;
|
|
|
|
|
required UTF8String name;
|
|
|
|
|
record<UTF8String, UTF8String> extra;
|
2020-12-09 11:51:44 +03:00
|
|
|
|
};
|
2020-12-10 16:20:04 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanEvent : GleanMetric {
|
|
|
|
|
|
2020-12-10 16:20:04 +03:00
|
|
|
|
/*
|
|
|
|
|
* Record an event.
|
|
|
|
|
*
|
|
|
|
|
* @param aExtra An (optional) map of extra values.
|
|
|
|
|
*/
|
2023-09-19 20:39:10 +03:00
|
|
|
|
undefined _record(optional record<UTF8String, UTF8String?> aExtra);
|
2020-12-10 16:20:04 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Gets the currently stored value.
|
2020-12-10 16:20:04 +03:00
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
2020-12-17 15:42:26 +03:00
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-03-18 14:21:28 +03:00
|
|
|
|
*
|
|
|
|
|
* The difference between event timestamps is in milliseconds
|
|
|
|
|
* See https://mozilla.github.io/glean/book/user/metrics/event.html for further details.
|
|
|
|
|
* Due to limitations of numbers in JavaScript, the timestamp will only be accurate up until 2^53.
|
|
|
|
|
* (This is probably not an issue with the current clock implementation. Probably.)
|
2020-12-10 16:20:04 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
sequence<GleanEventRecord>? testGetValue(optional UTF8String aPingName = "");
|
2020-12-10 16:20:04 +03:00
|
|
|
|
};
|
2021-04-21 18:40:47 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanQuantity : GleanMetric {
|
2021-04-21 18:40:47 +03:00
|
|
|
|
/**
|
|
|
|
|
* Set to the specified value.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @param aValue The value to set the metric to.
|
2021-04-21 18:40:47 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
undefined set(long long aValue);
|
2021-04-21 18:40:47 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-04-21 18:40:47 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
long long? testGetValue(optional UTF8String aPingName = "");
|
2021-04-21 18:40:47 +03:00
|
|
|
|
};
|
2021-07-15 19:05:51 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanDenominator : GleanMetric {
|
2021-07-15 19:05:51 +03:00
|
|
|
|
/*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Increases the counter by `aAmount`.
|
|
|
|
|
*
|
|
|
|
|
* @param aAmount The (optional) amount to increase by. Should be positive. Defaults to 1.
|
|
|
|
|
*/
|
|
|
|
|
undefined add(optional long aAmount = 1);
|
2021-07-15 19:05:51 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as an integer.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-07-15 19:05:51 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
long? testGetValue(optional UTF8String aPingName = "");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dictionary GleanRateData {
|
|
|
|
|
required long numerator;
|
|
|
|
|
required long denominator;
|
2021-07-15 19:05:51 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanNumerator : GleanMetric {
|
2021-07-15 19:05:51 +03:00
|
|
|
|
/*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Increases the numerator by `aAmount`.
|
|
|
|
|
*
|
|
|
|
|
* @param aAmount The (optional) amount to increase by. Should be positive. Defaults to 1.
|
|
|
|
|
*/
|
|
|
|
|
undefined addToNumerator(optional long aAmount = 1);
|
2021-07-15 19:05:51 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value in the form {numerator: n, denominator: d}
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-07-15 19:05:51 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
GleanRateData? testGetValue(optional UTF8String aPingName = "");
|
2021-07-15 19:05:51 +03:00
|
|
|
|
};
|
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanRate : GleanMetric {
|
2021-07-15 19:05:51 +03:00
|
|
|
|
/*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Increases the numerator by `amount`.
|
|
|
|
|
*
|
|
|
|
|
* @param aAmount The (optional) amount to increase by. Should be positive. Defaults to 1.
|
|
|
|
|
*/
|
|
|
|
|
undefined addToNumerator(optional long aAmount = 1);
|
2021-07-15 19:05:51 +03:00
|
|
|
|
|
|
|
|
|
/*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Increases the denominator by `amount`.
|
|
|
|
|
*
|
|
|
|
|
* @param aAmount The (optional) amount to increase by. Should be positive. Defaults to 1.
|
|
|
|
|
*/
|
|
|
|
|
undefined addToDenominator(optional long aAmount = 1);
|
2021-07-15 19:05:51 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value in the form {numerator: n, denominator: d}
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2021-07-15 19:05:51 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
GleanRateData? testGetValue(optional UTF8String aPingName = "");
|
2021-07-15 19:05:51 +03:00
|
|
|
|
};
|
2022-05-02 19:05:55 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanUrl : GleanMetric {
|
|
|
|
|
/**
|
|
|
|
|
* Set to the specified value.
|
|
|
|
|
*
|
|
|
|
|
* @param aValue The stringified URL to set the metric to.
|
|
|
|
|
*/
|
|
|
|
|
undefined set(UTF8String aValue);
|
2022-05-02 19:05:55 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* Gets the currently stored value.
|
2022-05-02 19:05:55 +03:00
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2022-05-02 19:05:55 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
UTF8String? testGetValue(optional UTF8String aPingName = "");
|
2022-05-02 19:05:55 +03:00
|
|
|
|
};
|
2023-05-09 18:03:07 +03:00
|
|
|
|
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanText : GleanMetric {
|
|
|
|
|
/**
|
|
|
|
|
* Set to the provided value.
|
|
|
|
|
*
|
|
|
|
|
* @param aValue The text to set the metric to.
|
|
|
|
|
*/
|
|
|
|
|
undefined set(UTF8String aValue);
|
2023-05-09 18:03:07 +03:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as a string.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
2023-09-19 20:39:09 +03:00
|
|
|
|
* @return value of the stored metric, or null if there is no value.
|
2023-05-09 18:03:07 +03:00
|
|
|
|
*/
|
2023-09-19 20:39:09 +03:00
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
UTF8String? testGetValue(optional UTF8String aPingName = "");
|
2023-05-09 18:03:07 +03:00
|
|
|
|
};
|
2024-03-06 17:00:01 +03:00
|
|
|
|
|
|
|
|
|
[Func="nsGlobalWindowInner::IsGleanNeeded", Exposed=Window]
|
|
|
|
|
interface GleanObject : GleanMetric {
|
|
|
|
|
/**
|
|
|
|
|
* Set to the specified object.
|
|
|
|
|
*
|
|
|
|
|
* The structure of the metric is validated against the predefined structure.
|
|
|
|
|
*
|
|
|
|
|
* @param object The object to set the metric to.
|
|
|
|
|
*/
|
|
|
|
|
undefined set(object value);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* **Test-only API**
|
|
|
|
|
*
|
|
|
|
|
* Gets the currently stored value as an object.
|
|
|
|
|
*
|
|
|
|
|
* This function will attempt to await the last parent-process task (if any)
|
|
|
|
|
* writing to the the metric's storage engine before returning a value.
|
|
|
|
|
* This function will not wait for data from child processes.
|
|
|
|
|
*
|
|
|
|
|
* This doesn't clear the stored value.
|
|
|
|
|
* Parent process only. Panics in child processes.
|
|
|
|
|
*
|
|
|
|
|
* @param aPingName The (optional) name of the ping to retrieve the metric
|
|
|
|
|
* for. Defaults to the first value in `send_in_pings`.
|
|
|
|
|
*
|
|
|
|
|
* @return value of the stored metric, or undefined if there is no value.
|
|
|
|
|
*/
|
|
|
|
|
[Throws, ChromeOnly]
|
|
|
|
|
object? testGetValue(optional UTF8String aPingName = "");
|
|
|
|
|
};
|