A flag indicating if Telemetry is allowed to record extended data. Returns false if the user hasn't opted into "extended Telemetry" on the Release channel, when the user has explicitly opted out of Telemetry on Nightly/Aurora/Beta or if manually set to false during tests.
Set this to false in tests to disable gathering of extended telemetry statistics.
Readonly
canA flag indicating whether Telemetry is recording prerelease data, which is a largish amount of usage data that we're prepared to handle from our smallish pre-release population.
This is true on pre-release branches of Firefox.
This does not indicate whether Telemetry will send any data. That is governed by user preference and other mechanisms.
You may use this to determine if it's okay to record your data.
Readonly
canA flag indicating whether Telemetry is recording release data, which is a smallish subset of our usage data that we're prepared to handle from our largish release population.
This is true most of the time.
This will always return true in the case of a non-content child process. Only values returned on the parent process are valid.
This does not indicate whether Telemetry will send any data. That is governed by user preference and other mechanisms.
You may use this to determine if it's okay to record your data.
Readonly
debugSee slowSQL above.
An object containing full strings of every slow SQL statement if toolkit.telemetry.debugSlowSql = true The returned SQL strings may contain private information and should not be reported to Telemetry.
Readonly
failedThe number of failed profile lock attempts that have occurred prior to successfully locking the profile
Readonly
fileIOReportsGet statistics of file IO reports, null, if not recorded.
The statistics are returned as an object whose propoerties are the names of the files that have been accessed and whose corresponding values are arrays of size three, representing startup, normal, and shutdown stages. Each stage's entry is either null or an array with the layout [total_time, #creates, #reads, #writes, #fsyncs, #stats]
Readonly
isA flag indicating whether Telemetry can submit official results (for base or extended data). This is true on official, non-debug builds with built in support for Mozilla Telemetry reporting.
This will always return true in the case of a non-content child process. Only values returned on the parent process are valid.
Readonly
lastThe amount of time, in milliseconds, that the last session took to shutdown. Reads as 0 to indicate failure.
Readonly
lateAn object with two fields: memoryMap and stacks.
Readonly
slowSQLAn object containing information about slow SQL statements.
{
mainThread: { "sqlString1": [
where: mainThread: Slow statements that executed on the main thread otherThreads: Slow statements that executed on a non-main thread sqlString - String of the offending statement (see note) hit count - The number of times this statement required longer than the threshold time to execute total time - The sum of all execution times above the threshold time for this statement
Note that dynamic SQL strings and SQL strings executed against addon DBs could contain private information. This property represents such SQL as aggregate database-level stats and the sqlString contains the database filename instead.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
Serializes the histogram labels for categorical hitograms. The returned structure looks like: { "histogram1": [ "histogram1_label1", "histogram1_label2", ...], "histogram2": [ "histogram2_label1", "histogram2_label2", ...] ... }
Note that this function should only be used in tests and about:telemetry.
Create and return a histogram registered in TelemetryHistograms.h.
unique identifier from TelemetryHistograms.h
The returned object has the following functions:
add(value) - Adds a sample of value
to the histogram.
value
may be a categorical histogram's label as a string,
a boolean histogram's value as a boolean,
or a number that fits inside a uint32_t.
snapshot([optional] {store}) - Returns a snapshot of the histogram with the same data fields
as in getSnapshotForHistograms().
Defaults to the "main" store.
clear([optional] {store}) - Zeros out the histogram's buckets and sum.
Defaults to the "main" store.
Note: This is intended to be only used in tests.
Create and return a histogram registered in TelemetryHistograms.h.
unique identifier from TelemetryHistograms.h
The returned object has the following functions:
add(string key, [optional] value) - Adds a sample of value
to the histogram for that key.
If no histogram for that key exists yet, it is created.
value
may be a categorical histogram's label as a string,
a boolean histogram's value as a boolean,
or a number that fits inside a uint32_t.
snapshot([optional] {store}) - Returns the snapshots of all the registered keys in the form
{key1: snapshot1, key2: snapshot2, ...} in the specified store.
Defaults to the "main" store.
keys([optional] {store}) - Returns an array with the string keys of the currently registered
histograms in the given store.
Defaults to "main".
clear([optional] {store}) - Clears the registered histograms from this.
Defaults to the "main" store.
Note: This is intended to be only used in tests.
Asynchronously get an array of the modules loaded in the process.
The data has the following structure:
[
{
"name":
A promise that resolves to an array of modules or rejects with NS_ERROR_FAILURE on failure.
NS_ERROR_NOT_IMPLEMENTED if the Gecko profiler is not enabled.
Serializes the histograms from the given store to a JSON-style object. The returned structure looks like: { "process": { "name1": histogramData1, "name2": histogramData2 }, ... }
Each histogram is represented in a packed format and has the following properties: bucket_count - Number of buckets of this histogram histogram_type - HISTOGRAM_EXPONENTIAL, HISTOGRAM_LINEAR, HISTOGRAM_BOOLEAN, HISTOGRAM_FLAG, HISTOGRAM_COUNT, or HISTOGRAM_CATEGORICAL sum - sum of the bucket contents range - A 2-item array of minimum and maximum bucket size values - Map from bucket to the bucket's count
The name of the store to snapshot.
Defaults to "main".
Custom stores are available when probes have them defined.
See the record_into_store
attribute on histograms.
Whether to clear out the histograms in the named store after snapshotting. Defaults to false.
If true, TELEMETRY_TEST_
histograms will be filtered out.
Filtered histograms are still cleared if aClearStore
is true.
Defaults to false.
Serializes the keyed histograms from the given store to a JSON-style object. The returned structure looks like: { "process": { "name1": { "key_1": histogramData1, "key_2": histogramData2 }, ...}, ... }
The name of the store to snapshot.
Defaults to "main".
Custom stores are available when probes have them defined.
See the record_into_store
attribute on histograms.
Whether to clear out the keyed histograms in the named store after snapshotting. Defaults to false.
If true, TELEMETRY_TEST_
histograms will be filtered out.
Filtered histograms are still cleared if aClearStore
is true.
Defaults to false.
Serializes the keyed scalars from the given store to a JSON-style object. The returned structure looks like: { "process": { "category1.probe": { "key_1": 2, "key_2": 1, ... }, ... }, ... }
The name of the store to snapshot.
Defaults to "main".
Custom stores are available when probes have them defined.
See the record_into_store
attribute on scalars.
Whether to clear out the keyed scalars in the named store after snapshotting. Defaults to false.
If true, telemetry.test
scalars will be filtered out.
Filtered scalars are still cleared if aClearStore
is true.
Defaults to false.
Serializes the scalars from the given store to a JSON-style object. The returned structure looks like: { "process": { "category1.probe": 1,"category1.other_probe": false, ... }, ... }.
The name of the store to snapshot.
Defaults to "main".
Custom stores are available when probes have them defined.
See the record_into_store
attribute on scalars.
Whether to clear out the scalars in the named store after snapshotting. Defaults to false.
If true, telemetry.test
scalars will be filtered out.
Filtered scalars are still cleared if aClearStore
is true.
Defaults to false.
An array of untrusted module load events. Each element describes one or more modules that were loaded, contextual information at the time of the event (including stack trace), and flags describing the module's trustworthiness.
Combination (bitwise OR) of the flags specified above. Defaults to 0.
Sets the keyed scalar to the given value.
The scalar name.
The key name.
The value to set the scalar to. If the type of aValue doesn't match the type of the scalar, the function will fail.
Sets the keyed scalar to the maximum of the current and the passed value.
The scalar name.
The key name.
The numeric value to set the scalar to. Only unsigned integers supported.
Return the number of milliseconds since process start using monotonic timestamps (unaffected by system clock changes). On Windows, this includes the period of time the device was suspended. On Linux and macOS, this does not include the period of time the device was suspneded.
Record an event in Telemetry.
NS_ERROR_INVALID_ARG When trying to record an unknown event.
The category name.
The method name.
The object name.
An optional string value to record.
Parent process only. Register dynamic builtin events. The parameters have the same meaning as the usual |registerEvents| function.
This function is only meant to be used to support the "artifact build"/ "build faster" developers by allowing to add new events without rebuilding the C++ components including the headers files.
Parent process only. Register dynamic builtin scalars. The parameters have the same meaning as the usual |registerScalars| function.
This function is only meant to be used to support the "artifact build"/ "build faster" developers by allowing to add new scalars without rebuilding the C++ components including the headers files.
Register new events to record them from addons. This allows registering multiple events for a category. They will be valid only for the current Firefox session. Note that events shipping in Firefox should be registered in Events.yaml.
The unique category the events are registered in.
An object that contains registration data for 1-N events of the form: { "categoryName": { "methods": ["test1"], "objects": ["object1"], "record_on_release": false, "extra_keys": ["key1", "key2"], // optional "expired": false // optional, defaults to false. }, ... }
Parent process only. Register new scalars to record them from addons. This allows registering multiple scalars for a category. They will be valid only for the current Firefox session. Note that scalars shipping in Firefox should be registered in Scalars.yaml.
The unique category the scalars are registered in.
An object that contains registration data for multiple scalars in the form: { "sample_scalar": { "kind": Ci.nsITelemetry.SCALAR_TYPE_COUNT, "keyed": true, //optional, defaults to false "record_on_release: true, // optional, defaults to false "expired": false // optional, defaults to false. }, ... }
Sets the scalar to the given value.
The scalar name.
The value to set the scalar to. If the type of aValue doesn't match the type of the scalar, the function will fail. For scalar string types, the this is truncated to 50 characters.
Enable recording of events in a category. Events default to recording disabled. This allows to toggle recording for all events in the specified category.
The category name.
Whether recording is enabled for events in that category.
Enable/disable recording for this histogram at runtime. Recording is enabled by default, unless listed at kRecordingInitiallyDisabledIDs[]. Name must be a valid Histogram identifier, otherwise an assertion will be triggered.
unique identifier from histograms.json
whether or not to enable recording from now on.
Serializes the recorded events to a JSON-appropriate array and optionally resets them. The returned structure looks like this: [ // [timestamp, category, method, object, stringValue, extraValues] [43245, "category1", "method1", "object1", "string value", null], [43258, "category1", "method2", "object1", null, {"key1": "string value"}], ... ]
DATASET_ALL_CHANNELS or DATASET_PRERELEASE_CHANNELS.
Optional
aClear: null | booleanWhether to clear out the flushed events after snapshotting.
How many events per process to limit the snapshot to contain, all if unspecified. Even if aClear, the leftover event records are not cleared.
Generated using TypeDoc
A flag indicating if Telemetry can record base data (FHR data). This is true if the FHR data reporting service or self-support are enabled.
In the unlikely event that adding a new base probe is needed, please check the data collection wiki at https://wiki.mozilla.org/Firefox/Data_Collection and talk to the Telemetry team.