summaryrefslogtreecommitdiffstats
path: root/toolkit/components/telemetry/geckoview
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/telemetry/geckoview')
-rw-r--r--toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp236
-rw-r--r--toolkit/components/telemetry/geckoview/gtest/moz.build28
-rw-r--r--toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp282
-rw-r--r--toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.h54
-rw-r--r--toolkit/components/telemetry/geckoview/streaming/metrics.yaml1695
5 files changed, 2295 insertions, 0 deletions
diff --git a/toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp b/toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp
new file mode 100644
index 0000000000..740cb783e7
--- /dev/null
+++ b/toolkit/components/telemetry/geckoview/gtest/TestGeckoViewStreaming.cpp
@@ -0,0 +1,236 @@
+/* vim:set ts=2 sw=2 sts=2 et: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+#include "mozilla/Preferences.h"
+#include "mozilla/Services.h"
+#include "mozilla/Telemetry.h"
+#include "nsIObserverService.h"
+#include "nsThreadUtils.h"
+#include "TelemetryFixture.h"
+#include "TelemetryTestHelpers.h"
+#include "streaming/GeckoViewStreamingTelemetry.h"
+
+using namespace mozilla;
+using namespace mozilla::Telemetry;
+using namespace TelemetryTestHelpers;
+using GeckoViewStreamingTelemetry::StreamingTelemetryDelegate;
+using mozilla::Telemetry::ScalarID;
+using ::testing::_;
+using ::testing::Eq;
+using ::testing::StrictMock;
+
+namespace {
+
+const char* kGeckoViewStreamingPref = "toolkit.telemetry.geckoview.streaming";
+const char* kBatchTimeoutPref = "toolkit.telemetry.geckoview.batchDurationMS";
+
+constexpr auto kTestHgramName = "TELEMETRY_TEST_STREAMING"_ns;
+constexpr auto kTestHgramName2 = "TELEMETRY_TEST_STREAMING_2"_ns;
+constexpr auto kTestCategoricalName = "TELEMETRY_TEST_CATEGORICAL_OPTOUT"_ns;
+const HistogramID kTestHgram = Telemetry::TELEMETRY_TEST_STREAMING;
+const HistogramID kTestHgram2 = Telemetry::TELEMETRY_TEST_STREAMING_2;
+
+class TelemetryStreamingFixture : public TelemetryTestFixture {
+ protected:
+ virtual void SetUp() {
+ TelemetryTestFixture::SetUp();
+ Preferences::SetBool(kGeckoViewStreamingPref, true);
+ Preferences::SetInt(kBatchTimeoutPref, 5000);
+ }
+ virtual void TearDown() {
+ TelemetryTestFixture::TearDown();
+ Preferences::SetBool(kGeckoViewStreamingPref, false);
+ GeckoViewStreamingTelemetry::RegisterDelegate(nullptr);
+ }
+};
+
+class MockDelegate : public StreamingTelemetryDelegate {
+ public:
+ MOCK_METHOD2(ReceiveHistogramSamples,
+ void(const nsCString& aHistogramName,
+ const nsTArray<uint32_t>& aSamples));
+ MOCK_METHOD2(ReceiveCategoricalHistogramSamples,
+ void(const nsCString& aHistogramName,
+ const nsTArray<uint32_t>& aSamples));
+ MOCK_METHOD2(ReceiveBoolScalarValue,
+ void(const nsCString& aScalarName, bool aValue));
+ MOCK_METHOD2(ReceiveStringScalarValue,
+ void(const nsCString& aScalarName, const nsCString& aValue));
+ MOCK_METHOD2(ReceiveUintScalarValue,
+ void(const nsCString& aScalarName, uint32_t aValue));
+}; // class MockDelegate
+
+TEST_F(TelemetryStreamingFixture, HistogramSamples) {
+ const uint32_t kSampleOne = 401;
+ const uint32_t kSampleTwo = 2019;
+
+ CopyableTArray<uint32_t> samplesArray;
+ samplesArray.AppendElement(kSampleOne);
+ samplesArray.AppendElement(kSampleTwo);
+
+ auto md = MakeRefPtr<MockDelegate>();
+ EXPECT_CALL(*md, ReceiveHistogramSamples(Eq(kTestHgramName),
+ Eq(std::move(samplesArray))));
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+
+ Telemetry::Accumulate(Telemetry::TELEMETRY_TEST_STREAMING, kSampleOne);
+ Preferences::SetInt(kBatchTimeoutPref, 0);
+ Telemetry::Accumulate(Telemetry::TELEMETRY_TEST_STREAMING, kSampleTwo);
+}
+
+TEST_F(TelemetryStreamingFixture, CategoricalHistogramSamples) {
+ auto kSampleOne =
+ Telemetry::LABELS_TELEMETRY_TEST_CATEGORICAL_OPTOUT::CommonLabel;
+ auto kSampleTwo = Telemetry::LABELS_TELEMETRY_TEST_CATEGORICAL_OPTOUT::Label5;
+
+ CopyableTArray<uint32_t> samplesArray;
+ samplesArray.AppendElement(static_cast<uint32_t>(kSampleOne));
+ samplesArray.AppendElement(static_cast<uint32_t>(kSampleOne));
+ samplesArray.AppendElement(static_cast<uint32_t>(kSampleTwo));
+
+ auto md = MakeRefPtr<MockDelegate>();
+ EXPECT_CALL(*md, ReceiveCategoricalHistogramSamples(
+ Eq(kTestCategoricalName), Eq(std::move(samplesArray))));
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+
+ Telemetry::AccumulateCategorical(kSampleOne);
+ Telemetry::AccumulateCategorical(kSampleOne);
+ Preferences::SetInt(kBatchTimeoutPref, 0);
+ Telemetry::AccumulateCategorical(kSampleTwo);
+}
+
+TEST_F(TelemetryStreamingFixture, MultipleHistograms) {
+ const uint32_t kSample1 = 400;
+ const uint32_t kSample2 = 1 << 31;
+ const uint32_t kSample3 = 7;
+ CopyableTArray<uint32_t> samplesArray1;
+ samplesArray1.AppendElement(kSample1);
+ samplesArray1.AppendElement(kSample2);
+ CopyableTArray<uint32_t> samplesArray2;
+ samplesArray2.AppendElement(kSample3);
+
+ auto md = MakeRefPtr<MockDelegate>();
+ EXPECT_CALL(*md, ReceiveHistogramSamples(Eq(kTestHgramName),
+ Eq(std::move(samplesArray1))));
+ EXPECT_CALL(*md, ReceiveHistogramSamples(Eq(kTestHgramName2),
+ Eq(std::move(samplesArray2))));
+
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+
+ Telemetry::Accumulate(kTestHgram, kSample1);
+ Telemetry::Accumulate(kTestHgram2, kSample3);
+ Preferences::SetInt(kBatchTimeoutPref, 0);
+ Telemetry::Accumulate(kTestHgram, kSample2);
+}
+
+// If we can find a way to convert the expectation's arg into an stl container,
+// we can use gmock's own ::testing::UnorderedElementsAre() instead.
+auto MatchUnordered(uint32_t sample1, uint32_t sample2) {
+ CopyableTArray<uint32_t> samplesArray1;
+ samplesArray1.AppendElement(sample1);
+ samplesArray1.AppendElement(sample2);
+
+ CopyableTArray<uint32_t> samplesArray2;
+ samplesArray2.AppendElement(sample2);
+ samplesArray2.AppendElement(sample1);
+
+ return ::testing::AnyOf(Eq(std::move(samplesArray1)),
+ Eq(std::move(samplesArray2)));
+}
+
+TEST_F(TelemetryStreamingFixture, MultipleThreads) {
+ const uint32_t kSample1 = 4;
+ const uint32_t kSample2 = 14;
+
+ auto md = MakeRefPtr<MockDelegate>();
+ // In this test, samples for the second test hgram are uninteresting.
+ EXPECT_CALL(*md, ReceiveHistogramSamples(Eq(kTestHgramName2), _));
+ EXPECT_CALL(*md, ReceiveHistogramSamples(Eq(kTestHgramName),
+ MatchUnordered(kSample1, kSample2)));
+
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+
+ nsCOMPtr<nsIThread> t1;
+ nsCOMPtr<nsIThread> t2;
+ nsCOMPtr<nsIThread> t3;
+
+ nsCOMPtr<nsIRunnable> r1 = NS_NewRunnableFunction(
+ "accumulate 4", [&]() { Telemetry::Accumulate(kTestHgram, kSample1); });
+ nsCOMPtr<nsIRunnable> r2 = NS_NewRunnableFunction(
+ "accumulate 14", [&]() { Telemetry::Accumulate(kTestHgram, kSample2); });
+
+ nsresult rv = NS_NewNamedThread("t1", getter_AddRefs(t1), r1);
+ EXPECT_TRUE(NS_SUCCEEDED(rv));
+ rv = NS_NewNamedThread("t2", getter_AddRefs(t2), r2);
+ EXPECT_TRUE(NS_SUCCEEDED(rv));
+
+ // Give the threads a chance to do their work.
+ PR_Sleep(PR_MillisecondsToInterval(1));
+
+ Preferences::SetInt(kBatchTimeoutPref, 0);
+ Telemetry::Accumulate(kTestHgram2, kSample1);
+}
+
+TEST_F(TelemetryStreamingFixture, ScalarValues) {
+ constexpr auto kBoolScalarName = "telemetry.test.boolean_kind"_ns;
+ constexpr auto kStringScalarName = "telemetry.test.string_kind"_ns;
+ constexpr auto kUintScalarName = "telemetry.test.unsigned_int_kind"_ns;
+
+ const bool kBoolScalarValue = true;
+ constexpr auto kStringScalarValue = "a string scalar value"_ns;
+ const uint32_t kUintScalarValue = 42;
+
+ auto md = MakeRefPtr<MockDelegate>();
+ EXPECT_CALL(
+ *md, ReceiveBoolScalarValue(Eq(kBoolScalarName), Eq(kBoolScalarValue)));
+ EXPECT_CALL(*md, ReceiveStringScalarValue(Eq(kStringScalarName),
+ Eq(kStringScalarValue)));
+ EXPECT_CALL(
+ *md, ReceiveUintScalarValue(Eq(kUintScalarName), Eq(kUintScalarValue)));
+
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+
+ Telemetry::ScalarSet(ScalarID::TELEMETRY_TEST_BOOLEAN_KIND, kBoolScalarValue);
+ Telemetry::ScalarSet(ScalarID::TELEMETRY_TEST_STRING_KIND,
+ NS_ConvertUTF8toUTF16(kStringScalarValue));
+ Preferences::SetInt(kBatchTimeoutPref,
+ 0); // Trigger batch on next accumulation.
+ Telemetry::ScalarSet(ScalarID::TELEMETRY_TEST_UNSIGNED_INT_KIND,
+ kUintScalarValue);
+}
+
+TEST_F(TelemetryStreamingFixture, ExpiredHistogram) {
+ const HistogramID kExpiredHistogram = Telemetry::TELEMETRY_TEST_EXPIRED;
+ const uint32_t kSample = 401;
+
+ // Strict Mock fails on any method calls.
+ auto md = MakeRefPtr<StrictMock<MockDelegate>>();
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+
+ Preferences::SetInt(kBatchTimeoutPref, 0);
+ Telemetry::Accumulate(kExpiredHistogram, kSample);
+}
+
+TEST_F(TelemetryStreamingFixture, SendOnAppBackground) {
+ constexpr auto kBoolScalarName = "telemetry.test.boolean_kind"_ns;
+ const bool kBoolScalarValue = true;
+ const char* kApplicationBackgroundTopic = "application-background";
+
+ auto md = MakeRefPtr<MockDelegate>();
+ EXPECT_CALL(
+ *md, ReceiveBoolScalarValue(Eq(kBoolScalarName), Eq(kBoolScalarValue)));
+
+ GeckoViewStreamingTelemetry::RegisterDelegate(md);
+ Telemetry::ScalarSet(ScalarID::TELEMETRY_TEST_BOOLEAN_KIND, kBoolScalarValue);
+
+ nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
+ ASSERT_TRUE(!!os)
+ << "Observer Service unavailable?!?!";
+ os->NotifyObservers(nullptr, kApplicationBackgroundTopic, nullptr);
+}
+
+} // namespace
diff --git a/toolkit/components/telemetry/geckoview/gtest/moz.build b/toolkit/components/telemetry/geckoview/gtest/moz.build
new file mode 100644
index 0000000000..eb6a2f9293
--- /dev/null
+++ b/toolkit/components/telemetry/geckoview/gtest/moz.build
@@ -0,0 +1,28 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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/.
+
+Library("telemetrygeckoviewtest")
+
+LOCAL_INCLUDES += [
+ "../",
+ "../..",
+ "../../..",
+ "/toolkit/components/telemetry/tests/gtest",
+ "/xpcom/io",
+]
+
+# GeckoView Streaming Telemetry is only available on Android.
+if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
+ UNIFIED_SOURCES += [
+ "TestGeckoViewStreaming.cpp",
+ ]
+
+# We need the following line otherwise including
+# "TelemetryHistogram.h" in tests will fail due to
+# missing headers.
+include("/ipc/chromium/chromium-config.mozbuild")
+
+FINAL_LIBRARY = "xul-gtest"
diff --git a/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp
new file mode 100644
index 0000000000..a52b5aadb0
--- /dev/null
+++ b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.cpp
@@ -0,0 +1,282 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+#include "GeckoViewStreamingTelemetry.h"
+
+#include "mozilla/Assertions.h"
+#include "mozilla/Services.h"
+#include "mozilla/StaticMutex.h"
+#include "mozilla/StaticPtr.h"
+#include "mozilla/StaticPrefs_toolkit.h"
+#include "mozilla/TimeStamp.h"
+#include "nsDataHashtable.h"
+#include "nsIObserver.h"
+#include "nsIObserverService.h"
+#include "nsITimer.h"
+#include "nsTArray.h"
+#include "nsThreadUtils.h"
+
+using mozilla::Runnable;
+using mozilla::StaticMutex;
+using mozilla::StaticMutexAutoLock;
+using mozilla::StaticRefPtr;
+using mozilla::TimeStamp;
+
+// Batches and streams Telemetry samples to a JNI delegate which will
+// (presumably) do something with the data. Expected to be used to route data
+// up to the Android Components layer to be translated into Glean metrics.
+namespace GeckoViewStreamingTelemetry {
+
+class LifecycleObserver;
+void SendBatch(const StaticMutexAutoLock& aLock);
+
+// Topic on which we flush the batch.
+static const char* const kApplicationBackgroundTopic = "application-background";
+
+static StaticMutex gMutex;
+
+// -- The following state is accessed across threads.
+// -- Do not touch these if you do not hold gMutex.
+
+// The time the batch began.
+TimeStamp gBatchBegan;
+// The batch of histograms and samples.
+typedef nsDataHashtable<nsCStringHashKey, nsTArray<uint32_t>> HistogramBatch;
+HistogramBatch gBatch;
+HistogramBatch gCategoricalBatch;
+// The batches of Scalars and their values.
+typedef nsDataHashtable<nsCStringHashKey, bool> BoolScalarBatch;
+BoolScalarBatch gBoolScalars;
+typedef nsDataHashtable<nsCStringHashKey, nsCString> StringScalarBatch;
+StringScalarBatch gStringScalars;
+typedef nsDataHashtable<nsCStringHashKey, uint32_t> UintScalarBatch;
+UintScalarBatch gUintScalars;
+// The delegate to receive the samples and values.
+StaticRefPtr<StreamingTelemetryDelegate> gDelegate;
+// Lifecycle observer used to flush the batch when backgrounded.
+StaticRefPtr<LifecycleObserver> gObserver;
+
+// -- End of gMutex-protected thread-unsafe-accessed data
+
+// Timer that ensures data in the batch never gets too stale.
+// This timer may only be manipulated on the Main Thread.
+StaticRefPtr<nsITimer> gJICTimer;
+
+class LifecycleObserver final : public nsIObserver {
+ public:
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIOBSERVER
+
+ LifecycleObserver() = default;
+
+ protected:
+ ~LifecycleObserver() = default;
+};
+
+NS_IMPL_ISUPPORTS(LifecycleObserver, nsIObserver);
+
+NS_IMETHODIMP
+LifecycleObserver::Observe(nsISupports* aSubject, const char* aTopic,
+ const char16_t* aData) {
+ if (!strcmp(aTopic, kApplicationBackgroundTopic)) {
+ StaticMutexAutoLock lock(gMutex);
+ SendBatch(lock);
+ }
+ return NS_OK;
+}
+
+void RegisterDelegate(const RefPtr<StreamingTelemetryDelegate>& aDelegate) {
+ StaticMutexAutoLock lock(gMutex);
+ gDelegate = aDelegate;
+}
+
+class SendBatchRunnable : public Runnable {
+ public:
+ explicit SendBatchRunnable(RefPtr<StreamingTelemetryDelegate> aDelegate,
+ HistogramBatch&& aBatch,
+ HistogramBatch&& aCategoricalBatch,
+ BoolScalarBatch&& aBoolScalars,
+ StringScalarBatch&& aStringScalars,
+ UintScalarBatch&& aUintScalars)
+ : Runnable("SendBatchRunnable"),
+ mDelegate(std::move(aDelegate)),
+ mBatch(std::move(aBatch)),
+ mCategoricalBatch(std::move(aCategoricalBatch)),
+ mBoolScalars(std::move(aBoolScalars)),
+ mStringScalars(std::move(aStringScalars)),
+ mUintScalars(std::move(aUintScalars)) {}
+
+ NS_IMETHOD Run() override {
+ MOZ_ASSERT(NS_IsMainThread());
+ MOZ_ASSERT(mDelegate);
+
+ if (gJICTimer) {
+ gJICTimer->Cancel();
+ }
+
+ for (auto iter = mBatch.Iter(); !iter.Done(); iter.Next()) {
+ const nsCString& histogramName = PromiseFlatCString(iter.Key());
+ const nsTArray<uint32_t>& samples = iter.Data();
+
+ mDelegate->ReceiveHistogramSamples(histogramName, samples);
+ }
+ mBatch.Clear();
+
+ for (auto iter = mCategoricalBatch.Iter(); !iter.Done(); iter.Next()) {
+ const nsCString& histogramName = PromiseFlatCString(iter.Key());
+ const nsTArray<uint32_t>& samples = iter.Data();
+
+ mDelegate->ReceiveCategoricalHistogramSamples(histogramName, samples);
+ }
+ mCategoricalBatch.Clear();
+
+ for (auto iter = mBoolScalars.Iter(); !iter.Done(); iter.Next()) {
+ const nsCString& scalarName = PromiseFlatCString(iter.Key());
+ mDelegate->ReceiveBoolScalarValue(scalarName, iter.Data());
+ }
+ mBoolScalars.Clear();
+
+ for (auto iter = mStringScalars.Iter(); !iter.Done(); iter.Next()) {
+ const nsCString& scalarName = PromiseFlatCString(iter.Key());
+ const nsCString& scalarValue = PromiseFlatCString(iter.Data());
+ mDelegate->ReceiveStringScalarValue(scalarName, scalarValue);
+ }
+ mStringScalars.Clear();
+
+ for (auto iter = mUintScalars.Iter(); !iter.Done(); iter.Next()) {
+ const nsCString& scalarName = PromiseFlatCString(iter.Key());
+ mDelegate->ReceiveUintScalarValue(scalarName, iter.Data());
+ }
+ mUintScalars.Clear();
+
+ return NS_OK;
+ }
+
+ private:
+ RefPtr<StreamingTelemetryDelegate> mDelegate;
+ HistogramBatch mBatch;
+ HistogramBatch mCategoricalBatch;
+ BoolScalarBatch mBoolScalars;
+ StringScalarBatch mStringScalars;
+ UintScalarBatch mUintScalars;
+}; // class SendBatchRunnable
+
+// Can be called on any thread.
+// NOTE: Pay special attention to what you call in this method as if it
+// accumulates to a gv-streaming-enabled probe we will deadlock the calling
+// thread.
+void SendBatch(const StaticMutexAutoLock& aLock) {
+ if (!gDelegate) {
+ NS_WARNING(
+ "Being asked to send Streaming Telemetry with no registered Streaming "
+ "Telemetry Delegate. Will try again later.");
+ // Give us another full Batch Duration to register a delegate.
+ gBatchBegan = TimeStamp::Now();
+ return;
+ }
+
+ // To make it so accumulations within the delegation don't deadlock us,
+ // move the batches' contents into the Runner.
+ HistogramBatch histogramCopy;
+ gBatch.SwapElements(histogramCopy);
+ HistogramBatch categoricalCopy;
+ gCategoricalBatch.SwapElements(categoricalCopy);
+ BoolScalarBatch boolScalarCopy;
+ gBoolScalars.SwapElements(boolScalarCopy);
+ StringScalarBatch stringScalarCopy;
+ gStringScalars.SwapElements(stringScalarCopy);
+ UintScalarBatch uintScalarCopy;
+ gUintScalars.SwapElements(uintScalarCopy);
+ RefPtr<SendBatchRunnable> runnable = new SendBatchRunnable(
+ gDelegate, std::move(histogramCopy), std::move(categoricalCopy),
+ std::move(boolScalarCopy), std::move(stringScalarCopy),
+ std::move(uintScalarCopy));
+
+ // To make things easier for the delegate, dispatch to the main thread.
+ NS_DispatchToMainThread(runnable);
+}
+
+// Can be called on any thread.
+void BatchCheck(const StaticMutexAutoLock& aLock) {
+ if (!gObserver) {
+ gObserver = new LifecycleObserver();
+ nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
+ if (os) {
+ os->AddObserver(gObserver, kApplicationBackgroundTopic, false);
+ }
+ }
+ if (gBatchBegan.IsNull()) {
+ // Time to begin a new batch.
+ gBatchBegan = TimeStamp::Now();
+ // Set a just-in-case timer to enforce an upper-bound on batch staleness.
+ NS_DispatchToMainThread(NS_NewRunnableFunction(
+ "GeckoviewStreamingTelemetry::ArmTimer", []() -> void {
+ if (!gJICTimer) {
+ gJICTimer = NS_NewTimer().take();
+ }
+ if (gJICTimer) {
+ gJICTimer->InitWithNamedFuncCallback(
+ [](nsITimer*, void*) -> void {
+ StaticMutexAutoLock locker(gMutex);
+ SendBatch(locker);
+ },
+ nullptr,
+ mozilla::StaticPrefs::
+ toolkit_telemetry_geckoview_maxBatchStalenessMS(),
+ nsITimer::TYPE_ONE_SHOT_LOW_PRIORITY,
+ "GeckoviewStreamingTelemetry::SendBatch");
+ }
+ }));
+ }
+ double batchDurationMs = (TimeStamp::Now() - gBatchBegan).ToMilliseconds();
+ if (batchDurationMs >
+ mozilla::StaticPrefs::toolkit_telemetry_geckoview_batchDurationMS()) {
+ SendBatch(aLock);
+ gBatchBegan = TimeStamp();
+ }
+}
+
+// Can be called on any thread.
+void HistogramAccumulate(const nsCString& aName, bool aIsCategorical,
+ uint32_t aValue) {
+ StaticMutexAutoLock lock(gMutex);
+
+ if (aIsCategorical) {
+ nsTArray<uint32_t>& samples = gCategoricalBatch.GetOrInsert(aName);
+ samples.AppendElement(aValue);
+ } else {
+ nsTArray<uint32_t>& samples = gBatch.GetOrInsert(aName);
+ samples.AppendElement(aValue);
+ }
+
+ BatchCheck(lock);
+}
+
+void BoolScalarSet(const nsCString& aName, bool aValue) {
+ StaticMutexAutoLock lock(gMutex);
+
+ gBoolScalars.Put(aName, aValue);
+
+ BatchCheck(lock);
+}
+
+void StringScalarSet(const nsCString& aName, const nsCString& aValue) {
+ StaticMutexAutoLock lock(gMutex);
+
+ gStringScalars.Put(aName, aValue);
+
+ BatchCheck(lock);
+}
+
+void UintScalarSet(const nsCString& aName, uint32_t aValue) {
+ StaticMutexAutoLock lock(gMutex);
+
+ gUintScalars.Put(aName, aValue);
+
+ BatchCheck(lock);
+}
+
+} // namespace GeckoViewStreamingTelemetry
diff --git a/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.h b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.h
new file mode 100644
index 0000000000..720a6ff042
--- /dev/null
+++ b/toolkit/components/telemetry/geckoview/streaming/GeckoViewStreamingTelemetry.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+#ifndef GeckoViewStreamingTelemetry_h__
+#define GeckoViewStreamingTelemetry_h__
+
+#include "mozilla/RefCounted.h"
+#include "mozilla/RefPtr.h"
+#include "nsISupportsImpl.h"
+#include "nsString.h"
+
+#include <cstdint>
+
+namespace GeckoViewStreamingTelemetry {
+
+void HistogramAccumulate(const nsCString& aName, bool aIsCategorical,
+ uint32_t aValue);
+
+void BoolScalarSet(const nsCString& aName, bool aValue);
+void StringScalarSet(const nsCString& aName, const nsCString& aValue);
+void UintScalarSet(const nsCString& aName, uint32_t aValue);
+
+// Classes wishing to receive Streaming Telemetry must implement this interface
+// and register themselves via RegisterDelegate.
+class StreamingTelemetryDelegate {
+ public:
+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(StreamingTelemetryDelegate)
+
+ // Receive* methods will be called from time to time on the main thread.
+ virtual void ReceiveHistogramSamples(const nsCString& aName,
+ const nsTArray<uint32_t>& aSamples) = 0;
+ virtual void ReceiveCategoricalHistogramSamples(
+ const nsCString& aName, const nsTArray<uint32_t>& aSamples) = 0;
+ virtual void ReceiveBoolScalarValue(const nsCString& aName, bool aValue) = 0;
+ virtual void ReceiveStringScalarValue(const nsCString& aName,
+ const nsCString& aValue) = 0;
+ virtual void ReceiveUintScalarValue(const nsCString& aName,
+ uint32_t aValue) = 0;
+
+ protected:
+ virtual ~StreamingTelemetryDelegate() = default;
+};
+
+// Registers the provided StreamingTelemetryDelegate to receive Streaming
+// Telemetry, overwriting any previous delegate registration.
+// Call on any thread.
+void RegisterDelegate(const RefPtr<StreamingTelemetryDelegate>& aDelegate);
+
+} // namespace GeckoViewStreamingTelemetry
+
+#endif // GeckoViewStreamingTelemetry_h__
diff --git a/toolkit/components/telemetry/geckoview/streaming/metrics.yaml b/toolkit/components/telemetry/geckoview/streaming/metrics.yaml
new file mode 100644
index 0000000000..d061c3bcfc
--- /dev/null
+++ b/toolkit/components/telemetry/geckoview/streaming/metrics.yaml
@@ -0,0 +1,1695 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# 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/.
+
+# This file defines the metrics that are recorded by the Glean SDK. They are
+# automatically converted to platform-specific code at build time using the
+# `glean_parser` PyPI package.
+
+---
+$schema: moz://mozilla.org/schemas/glean/metrics/1-0-0
+
+geckoview:
+ version:
+ description: >
+ The version of the Gecko engine, example: 74.0a1
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gecko.version
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1611240
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1611240#c2
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+
+ build_id:
+ description: >
+ The Buildid of the Gecko engine, example: 20200205124310
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gecko.build_id
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1611240
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1611240#c2
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+
+ content_process_lifetime:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GV_CONTENT_PROCESS_LIFETIME_MS
+ description: >
+ The uptime of content processes in ms
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1625325
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1625325#c2
+ notification_emails:
+ - geckoview-team@mozilla.com
+ - aklotz@mozilla.com
+ expires: never
+
+ page_load_progress_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GV_PAGE_LOAD_PROGRESS_MS
+ description: >
+ Time between page load progress starts (0) and completion (100).
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - geckoview-team@mozilla.com
+ - esawin@mozilla.com
+ expires: never
+
+ page_load_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GV_PAGE_LOAD_MS
+ description: >
+ The time taken to load a page. This includes all static contents, no
+ dynamic content.
+ Loading of about: pages is not counted.
+ Back back navigation (sometimes via BFCache) is included which is a
+ source of bimodality due to the <50ms load times.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - geckoview-team@mozilla.com
+ - esawin@mozilla.com
+ expires: never
+
+ page_reload_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GV_PAGE_RELOAD_MS
+ description: >
+ Time taken to reload a page.
+ This includes all static contents, no dynamic content.
+ Loading of about: pages is not counted.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1549519
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - geckoview-team@mozilla.com
+ - sefeng@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ startup_runtime:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GV_STARTUP_RUNTIME_MS
+ description: >
+ The time taken to initialize GeckoRuntime.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1499418
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - geckoview-team@mozilla.com
+ - esawin@mozilla.com
+ expires: never
+
+ document_site_origins:
+ type: custom_distribution
+ description: >
+ When a document is loaded, report the
+ number of [site origins](https://searchfox.org/
+ mozilla-central/rev/
+ 3300072e993ae05d50d5c63d815260367eaf9179/
+ caps/nsIPrincipal.idl#264) of the entire browser
+ if it has been at least 5 minutes since last
+ time we collect this data.
+ range_min: 0
+ range_max: 100
+ bucket_count: 50
+ histogram_type: exponential
+ unit: number of site_origin
+ gecko_datapoint: FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_ALL_TABS
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1589700
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1589700#c5
+ notification_emails:
+ - sefeng@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ per_document_site_origins:
+ type: custom_distribution
+ description: >
+ When a document is unloaded, report the highest number of
+ [site origins](https://searchfox.org/
+ mozilla-central/rev/
+ 3300072e993ae05d50d5c63d815260367eaf9179/
+ caps/nsIPrincipal.idl#264) loaded simultaneously in that
+ document.
+ range_min: 0
+ range_max: 100
+ bucket_count: 50
+ histogram_type: exponential
+ unit: number of site origins per document
+ gecko_datapoint: FX_NUMBER_OF_UNIQUE_SITE_ORIGINS_PER_DOCUMENT
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1603185
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1603185#c13
+ notification_emails:
+ - barret@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+gfx:
+ composite_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: COMPOSITE_TIME
+ description: >
+ The time taken to composite a frame.
+ On non-webrender this is the time taken in
+ `CompositorBridgeParent::CompositeToTarget()`.
+ On webrender, this is the time taken from the start of
+ `WebRenderBridgeParent::CompositeToTarget()`,
+ until the render thread has rendered the frame (in
+ `RenderThread::HandleFrameOneDoc()`).
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1080160
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1529352
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580129
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580129#c7
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jnicol@mozilla.com
+ expires: never
+
+ scroll_present_latency:
+ type: timing_distribution
+ time_unit: millisecond
+ description: >
+ Time between receiving a scroll
+ event on the event loop and compositing
+ its result onto the screen (ms).
+ gecko_datapoint: SCROLL_PRESENT_LATENCY
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1604818
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1604818#c4
+ notification_emails:
+ - sefeng@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+gfx.checkerboard:
+ duration:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: CHECKERBOARD_DURATION
+ description: >
+ The duration of a checkerboard event.
+ Checkerboarding is when painting has not kept up with asynchronous
+ panning and zooming so the compositor has to display a "checkerboard
+ pattern" (or in practice, the background color) rather than the actual
+ page content.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - botond@mozilla.com
+ expires: never
+
+ peak_pixel_count:
+ type: custom_distribution
+ range_max: 66355200
+ bucket_count: 50
+ histogram_type: exponential
+ unit: Pixels
+ gecko_datapoint: CHECKERBOARD_PEAK
+ description: >
+ The peak number of CSS pixels that checkerboarded during a checkerboard
+ event. The minimum value of the largest histogram bucket is the size of
+ a 4k display with maximum APZ zooming.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - botond@mozilla.com
+ expires: never
+
+ potential_duration:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: CHECKERBOARD_POTENTIAL_DURATION
+ description: >
+ The total amount of time that we could reasonably be checkerboarding.
+ This is the union of two possibly-intersecting sets of time periods:
+ The first set is that in which checkerboarding was actually happening,
+ since by definition it could potentially be happening.
+ The second set is that in which the APZC is actively transforming content
+ in the compositor, since it could potentially transform it so as to
+ display checkerboarding to the user. Combined with other information,
+ this allows us to meaningfully say how frequently users actually
+ enncounters checkerboarding.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - botond@mozilla.com
+ expires: never
+
+ severity:
+ type: custom_distribution
+ range_max: 1073741824
+ bucket_count: 50
+ histogram_type: exponential
+ unit: Opaque unit
+ gecko_datapoint: CHECKERBOARD_SEVERITY
+ description: >
+ An opaque measurement of the severity of a checkerboard event.
+ This doesn't have units, it's just useful for comparing two checkerboard
+ events to see which one is worse, for some implementation-specific
+ definition of "worse". The larger the value, the worse the
+ checkerboarding.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1238040
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1539309
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - botond@mozilla.com
+ expires: never
+
+gfx.content:
+ paint_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: CONTENT_PAINT_TIME
+ description: >
+ Time spent in the main-thread paint pipeline for content.
+ For non-webrender, this includes display list building, layer building,
+ and when OMTP is disabled, rasterization.
+ For webrender, this includes display list building, and webrender display
+ list building.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1309442
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - mwoodrow@mozilla.com
+ - dbolter@mozilla.com
+ expires: never
+
+ full_paint_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: CONTENT_FULL_PAINT_TIME
+ description: >
+ Time spent in the full paint pipeline for content until it's ready for
+ composition.
+ For non-webrender this includes `paint_time`, plus rasterization if OMTP
+ is enabled.
+ For webrender, this includes `paint_time`, plus scene building time.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1505858
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jmuizelaar@mozilla.com
+ - dbolter@mozilla.com
+ expires: never
+
+gfx.content.frame_time:
+ from_paint:
+ type: custom_distribution
+ range_max: 5000
+ bucket_count: 50
+ histogram_type: exponential
+ unit: Percentage of vsync interval
+ gecko_datapoint: CONTENT_FRAME_TIME
+ description: >
+ The time, in percentage of a vsync interval, spent from beginning a paint
+ in the content process until that frame is presented in the compositor.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1470528
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1509536
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jnicol@mozilla.com
+ expires: never
+
+ from_vsync:
+ type: custom_distribution
+ range_min: 8
+ range_max: 792
+ bucket_count: 100
+ histogram_type: linear
+ unit: Percentage of vsync interval
+ gecko_datapoint: CONTENT_FRAME_TIME_VSYNC
+ description: >
+ The time, in percentage of a vsync interval, spent from the vsync that
+ started a paint in the content process until that frame is presented in
+ the compositor.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1517355
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - mwoodrow@mozilla.com
+ expires: never
+
+ with_svg:
+ type: custom_distribution
+ range_max: 5000
+ bucket_count: 50
+ histogram_type: exponential
+ unit: Percentage of vsync interval
+ gecko_datapoint: CONTENT_FRAME_TIME_WITH_SVG
+ description: >
+ The time, in percentage of a vsync interval, spent from beginning a paint
+ in the content process until that frame is presented in the compositor,
+ for frames that contained an SVG to be drawn by webrender.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1483549
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1509536
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - mwoodrow@mozilla.com
+ expires: never
+
+ without_resource_upload:
+ type: custom_distribution
+ range_max: 5000
+ bucket_count: 50
+ histogram_type: exponential
+ unit: Percentage of vsync interval
+ gecko_datapoint: CONTENT_FRAME_TIME_WITHOUT_RESOURCE_UPLOAD
+ description: >
+ The time, in percentage of a vsync interval, spent from beginning a paint
+ in the content process until that frame is presented in the compositor by
+ webrender, excluding time spent uploading resources.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1503405
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - mwoodrow@mozilla.com
+ expires: never
+
+ without_upload:
+ type: custom_distribution
+ range_max: 5000
+ bucket_count: 50
+ histogram_type: exponential
+ unit: Percentage of vsync interval
+ gecko_datapoint: CONTENT_FRAME_TIME_WITHOUT_UPLOAD
+ description: >
+ The time, in percentage of a vsync interval, spent from beginning a paint
+ in the content process until that frame is presented in the compositor by
+ webrender, excluding time spent uploading any content.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1503405
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - mwoodrow@mozilla.com
+ expires: never
+
+ reason:
+ type: labeled_counter
+ labels:
+ - on_time
+ - no_vsync
+ - missed_composite
+ - slow_composite
+ - missed_composite_mid
+ - missed_composite_long
+ - missed_composite_low
+ - no_vsync_no_id
+ gecko_datapoint: CONTENT_FRAME_TIME_REASON
+ description: >
+ The reason that `gfx.content.frame_time.from_paint` recorded a slow
+ (>200ms) result, if any.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1510853
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - mwoodrow@mozilla.com
+ expires: never
+
+gfx.webrender:
+ scenebuild_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: WR_SCENEBUILD_TIME
+ description: >
+ The time taken to build a webrender scene.
+ This occurs each time webrender receives a new display list.
+ This additionally includes blob rasterization time.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jmuizelaar@mozilla.com
+ expires: never
+ sceneswap_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: WR_SCENESWAP_TIME
+ description: >
+ The time taken to do a webrender scene swap. This is book-keeping that
+ APZ must perform once webrender has built a new scene.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jmuizelaar@mozilla.com
+ expires: never
+ framebuild_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: WR_FRAMEBUILD_TIME
+ description: >
+ The time taken to build a webrender frame.
+ This involves calculating the visibility of primitives, requesting
+ resources, and building the render passes which will be used to render
+ the frame.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1470901
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1584109#c1
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jmuizelaar@mozilla.com
+ expires: never
+
+gfx.display:
+ count:
+ description: >
+ Amount of displays connected to the device
+ type: quantity
+ unit: Display count
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.display.count
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ primary_width:
+ description: >
+ Width of the primary display, takes device rotation into account.
+ type: quantity
+ unit: Pixels
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.display.primary_width
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ primary_height:
+ description: >
+ Height of the primary display, takes device rotation into account.
+ type: quantity
+ unit: Pixels
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.display.primary_height
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+gfx.adapter.primary:
+ description:
+ description: >
+ Long form description of the Graphics adapter
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.description
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ vendor_id:
+ description: >
+ Graphics adapter vendor identification
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.vendor_id
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ device_id:
+ description: >
+ Graphics adapter device identification
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.device_id
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ subsystem_id:
+ description: >
+ Graphics adapter subsystem identification
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.subsystem_id
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ ram:
+ description: >
+ Graphics adapter dedicated memory
+ type: quantity
+ unit: Megabytes
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.ram
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ driver_files:
+ description: >
+ List of graphics adapter driver files
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.driver_files
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: 2022-02-01
+ driver_vendor:
+ description: >
+ Graphics adapter driver vendor identification
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.driver_vendor
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ driver_version:
+ description: >
+ Graphics adapter driver version
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.driver_version
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: never
+ driver_date:
+ description: >
+ Graphics adapter driver date
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.adapter.driver_date
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: 2023-02-01
+
+gfx.status:
+ compositor:
+ description: >
+ Name of the graphics compositor in use.
+ Possible values are "opengl, d3d11, client, webrender or basic"
+ type: string
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.compositor
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: 2022-02-01
+ headless:
+ description: >
+ Boolean indicated whether graphics is running in
+ headless (no display) mode
+ type: boolean
+ # Temporary misuse of the user lifetime approved by Glean team
+ # due to limitations in Geckoview streaming telemetry.
+ # DO NOT DUPLICATE unless approved by Glean team.
+ lifetime: user
+ gecko_datapoint: gfx.headless
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1594145#c4
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ expires: 2022-02-01
+
+gfx.feature:
+ webrender:
+ type: string
+ description: Whether webrender is enabled or disabled, and why.
+ gecko_datapoint: gfx.feature.webrender
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1687312
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1687312#c5
+ notification_emails:
+ - gfx-telemetry-alerts@mozilla.com
+ - jnicol@mozilla.com
+ expires: never
+
+avif:
+ decode_result:
+ type: labeled_counter
+ labels:
+ - success
+ - parse_error
+ - no_primary_item
+ - decode_error
+ - size_overflow
+ - out_of_memory
+ - pipe_init_error
+ - write_buffer_error
+ - alpha_y_sz_mismatch
+ - alpha_y_bpc_mismatch
+ gecko_datapoint: AVIF_DECODE_RESULT
+ description: >
+ Decode result of AVIF image.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
+ notification_emails:
+ - cchang@mozilla.com
+ - jbauman@mozilla.com
+ expires: never
+
+ decoder:
+ type: labeled_counter
+ labels:
+ - dav1d
+ - aom
+ gecko_datapoint: AVIF_DECODER
+ description: >
+ Decoder of AVIF image.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
+ notification_emails:
+ - cchang@mozilla.com
+ - jbauman@mozilla.com
+ expires: never
+
+ aom_decode_error:
+ type: quantity
+ unit: error code
+ gecko_datapoint: avif.aom_decode_error
+ description: >
+ Image-decode Error from AOM decoder
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
+ notification_emails:
+ - cchang@mozilla.com
+ - jbauman@mozilla.com
+ expires: never
+
+ dav1d_decode_error:
+ type: quantity
+ unit: error code
+ gecko_datapoint: avif.dav1d_decode_error
+ description: >
+ Image-decode Error from dav1d decoder
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
+ notification_emails:
+ - cchang@mozilla.com
+ - jbauman@mozilla.com
+ expires: never
+
+ yuv_color_space:
+ type: labeled_counter
+ labels:
+ - bt601
+ - bt709
+ - bt2020
+ - identity
+ - unknown
+ gecko_datapoint: AVIF_YUV_COLOR_SPACE
+ description: >
+ YUV color space of AVIF image.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
+ notification_emails:
+ - cchang@mozilla.com
+ - jbauman@mozilla.com
+ expires: never
+
+ bit_depth:
+ type: labeled_counter
+ labels:
+ - color_8
+ - color_10
+ - color_12
+ - color_16
+ - unknown
+ gecko_datapoint: AVIF_BIT_DEPTH
+ description: >
+ Bits per pixel of AVIF image.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1670827#c9
+ notification_emails:
+ - cchang@mozilla.com
+ - jbauman@mozilla.com
+ expires: never
+
+network:
+ cache_hit_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: NETWORK_CACHE_V2_HIT_TIME_MS
+ description: >
+ Time to open existing cache entry file.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - hbambas@mozilla.com
+ - mnovotny@mozilla.com
+ expires: never
+
+ tls_handshake:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: HTTP_PAGE_TLS_HANDSHAKE
+ description: >
+ In the HTTP page channel, time from after the TCP SYN packet is
+ received to the secure connection is established and ready for HTTP.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=772589
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - necko@mozilla.com
+ - ddamjanovic@mozilla.com
+ expires: never
+
+ tcp_connection:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: HTTP_PAGE_TCP_CONNECTION_2
+ description: >
+ In the HTTP page channel, time from the TCP SYN packet is received to
+ the connection is established and ready for HTTP.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=772589
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - necko@mozilla.com
+ - ddamjanovic@mozilla.com
+ expires: never
+
+ dns_start:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: HTTP_PAGE_DNS_ISSUE_TIME
+ description: >
+ In the HTTP page channel, time from connection open to the DNS request
+ being issued.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - necko@mozilla.com
+ - vogosu@mozilla.com
+ expires: never
+
+ dns_end:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: HTTP_PAGE_DNS_LOOKUP_TIME
+ description: >
+ In the HTTP page channel, time from the DNS request being issued to
+ the response.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - necko@mozilla.com
+ - vogosu@mozilla.com
+ expires: never
+
+ font_download_end:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: WEBFONT_DOWNLOAD_TIME_AFTER_START
+ description: >
+ Time after navigationStart that all webfont downloads are completed.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - necko@mozilla.com
+ - bdekoz@mozilla.com
+ expires: never
+
+ first_from_cache:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: HTTP_PAGE_OPEN_TO_FIRST_FROM_CACHE_V2
+ description: >
+ In the HTTP page channel, time from connection open to cache read start.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - necko@mozilla.com
+ - mnovotny@mozilla.com
+ expires: never
+
+performance.pageload:
+ load_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_PAGE_LOAD_TIME_MS
+ description: >
+ Time in milliseconds from navigationStart to loadEventStart
+ for the foreground http or https root content document.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ load_time_responsestart:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_PAGE_LOAD_TIME_FROM_RESPONSESTART_MS
+ description: >
+ Time in milliseconds from responseStart to loadEventStart
+ for the foreground http or https root content document.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ dcl:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_DOM_CONTENT_LOADED_MS
+ description: >
+ Time in milliseconds from navigationStart to domContentLoaded
+ for the foreground http or https root content document.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ dcl_responsestart:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_DOM_CONTENT_LOADED_FROM_RESPONSESTART_MS
+ description: >
+ Time in milliseconds from responseStart to domContentLoaded
+ for the foreground http or https root content document.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ fcp:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_FIRST_CONTENTFUL_PAINT_MS
+ description: >
+ The time between navigationStart and the first contentful paint
+ of a foreground http or https root content document, in
+ milliseconds. The contentful paint timestamp is taken during
+ display list building and does not include rasterization or
+ compositing of that paint.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ fcp_responsestart:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_FIRST_CONTENTFUL_PAINT_FROM_RESPONSESTART_MS
+ description: >
+ The time between responseStart and the first contentful paint
+ of a foreground http or https root content document, in
+ milliseconds. The contentful paint timestamp is taken during
+ display list building and does not include rasterization or
+ compositing of that paint.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ req_anim_frame_callback:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_REQUEST_ANIMATION_CALLBACK_PAGELOAD_MS
+ description: >
+ Time spent in milliseconds calling all request animation frame callbacks
+ for a document before it has reached readystate complete.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+performance.responsiveness:
+ req_anim_frame_callback:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: PERF_REQUEST_ANIMATION_CALLBACK_NON_PAGELOAD_MS
+ description: >
+ Time spent in milliseconds calling all request animation frame callbacks
+ for a document after it has reached readystate complete.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671729#c7
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+
+performance.time:
+ response_start:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_RESPONSE_START_MS
+ description: >
+ Time from navigationStart to responseStart as per the W3C
+ Performance Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - vchin@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ dom_interactive:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_DOM_INTERACTIVE_MS
+ description: >
+ Time from navigationStart to domInteractive as per the W3C
+ Performance Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - hbambas@mozilla.com
+ - vgosu@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ dom_content_loaded_start:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_DOM_CONTENT_LOADED_START_MS
+ description: >
+ Time from navigationStart to domContentLoadedEventStart as per
+ the W3C Performance Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - bdekoz@mozilla.com
+ expires: never
+
+ dom_content_loaded_end:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_DOM_CONTENT_LOADED_END_MS
+ description: >
+ Time from navigationStart to domContentLoadedEventEnd as per
+ the W3C Performance Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - vchin@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ dom_complete:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_DOM_COMPLETE_MS
+ description: >
+ Time from navigationStart to domComplete as per the W3C Performance
+ Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - hbambas@mozilla.com
+ - vgosu@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ load_event_start:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_LOAD_EVENT_START_MS
+ description: >
+ Time from navigationStart to loadEventStart as per the W3C Performance
+ Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - bdekoz@mozilla.com
+ expires: never
+
+ load_event_end:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_LOAD_EVENT_END_MS
+ description: >
+ Time from navigationStart to loadEventEnd as per the W3C Performance
+ Timing API.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1344893
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - vchin@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ load_event_start_preload:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_LOAD_EVENT_START_PRELOAD_MS
+ description: >
+ Time from navigationStart to [`loadEventStart`](https://www.w3.org/TR/
+ navigation-timing/#dom-performancetiming-loadstart) as per the W3C
+ Performance Timing API. This is only submitted on when the document
+ would preload a resource (i.e., if it encounters a `<link>` element or
+ a `Link` header with `rel="preload"`), even if the `network.preload`
+ pref is disabled.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188#c5
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - barret@mozilla.com
+ expires: 2021-02-24
+
+ load_event_end_preload:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_LOAD_EVENT_END_PRELOAD_MS
+ description: >
+ Time from navigationStart to [`loadEventEnd`](https://www.w3.org/TR/
+ navigation-timing/#dom-performancetiming-loadend) as per the W3C
+ Performance Timing API. This is only submitted on when the document
+ would preload a resource (i.e., if it encounters a `<link>` element or
+ a `Link` header with `rel="preload"`), even if the `network.preload`
+ pref is disabled.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188#c5
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - barret@mozilla.com
+ expires: 2021-02-24
+
+ load_event_start_no_preload:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_LOAD_EVENT_START_NO_PRELOAD_MS
+ description: >
+ Time from navigationStart to [`loadEventStart`](https://www.w3.org/TR/
+ navigation-timing/#dom-performancetiming-loadstart) as per the W3C
+ Performance Timing API. This is only submitted on when the document
+ would not preload a resource.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188#c5
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - barret@mozilla.com
+ expires: 2021-02-24
+
+ load_event_end_no_preload:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_LOAD_EVENT_END_NO_PRELOAD_MS
+ description: >
+ Time from navigationStart to [`loadEventEnd`](https://www.w3.org/TR/
+ navigation-timing/#dom-performancetiming-loadend) as per the W3C
+ Performance Timing API. This is only submitted on when the document
+ would not preload a resource.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1657188#c5
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - barret@mozilla.com
+ expires: 2021-02-24
+
+performance.page:
+ non_blank_paint:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TIME_TO_NON_BLANK_PAINT_MS
+ description: >
+ The time between navigationStart and the first non-blank paint of a
+ foreground root content document, in milliseconds. This only records
+ documents that were in an active docshell throughout the whole time
+ between navigation start and non-blank paint. The non-blank paint
+ timestamp is taken during display list building and does not include
+ rasterization or compositing of that paint.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1307242
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1489524
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - vchin@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+ total_content_page_load:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: TOTAL_CONTENT_PAGE_LOAD_TIME
+ description: >
+ Time to load all of a page's resources and render.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - bdekoz@mozilla.com
+ expires: never
+
+performance.interaction:
+ keypress_present_latency:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: KEYPRESS_PRESENT_LATENCY
+ description: >
+ Time between receiving a keypress event in the event loop and compositing
+ its result onto the screen.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1506537
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - perf-telemetry-alerts@mozilla.com
+ - vchin@mozilla.com
+ expires: never
+
+ tab_switch_composite:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: FX_TAB_SWITCH_COMPOSITE_E10S_MS
+ description: >
+ Time between tab selection and first composite of the tab content onto the
+ screen.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1481704
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1529352
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1580077#c10
+ notification_emails:
+ - mconley@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: never
+
+js:
+ execution_percentage:
+ type: custom_distribution
+ description: >
+ Percentage of page load time spent executing Javascript.
+ range_min: 0
+ range_max: 100
+ bucket_count: 20
+ histogram_type: linear
+ unit: percentage of execution time
+ gecko_datapoint: JS_EXECUTION_PROPORTION
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475#c6
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: 2021-03-18
+ delazification_percentage:
+ type: custom_distribution
+ description: >
+ Percentage of execution time spent during delazification for
+ JS scripts up until the page load event fires.
+ range_min: 0
+ range_max: 100
+ bucket_count: 20
+ histogram_type: linear
+ unit: percentage of execution time
+ gecko_datapoint: JS_DELAZIFICATION_PROPORTION
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475#c6
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: 2021-03-18
+ xdr_encode_percentage:
+ type: custom_distribution
+ description: >
+ Percentage of execution time spent during XDR encoding for
+ JS scripts up until the page load event fires.
+ range_min: 0
+ range_max: 100
+ bucket_count: 20
+ histogram_type: linear
+ unit: percentage of execution time
+ gecko_datapoint: JS_XDR_ENCODING_PROPORTION
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475#c6
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: 2021-03-18
+ baseline_compile_percentage:
+ type: custom_distribution
+ description: >
+ Percentage of execution time spent during Baseline compilation for
+ JS scripts up until the page load event fires.
+ range_min: 0
+ range_max: 100
+ bucket_count: 20
+ histogram_type: linear
+ unit: percentage of execution time
+ gecko_datapoint: JS_BASELINE_COMPILE_PROPORTION
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475#c6
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: 2021-03-18
+ bytecode_caching_time:
+ type: timing_distribution
+ unit: milliseconds
+ description: >
+ Time spent caching JS bytecode for scripts executed during a page load.
+ gecko_datapoint: JS_BYTECODE_CACHING_TIME
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1664475#c6
+ notification_emails:
+ - dpalmeiro@mozilla.com
+ - perf-telemetry-alerts@mozilla.com
+ expires: 2021-03-18
+
+javascript.gc:
+ total_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GC_MS
+ description: >
+ The total time taken by a major collection.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c8
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ minor_time:
+ type: timing_distribution
+ time_unit: microsecond
+ gecko_datapoint: GC_MINOR_US
+ description: >
+ The time taked by a minor (nursery) collection.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ prepare_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GC_PREPARE_MS
+ description: >
+ The time spent in the preparation phase.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ mark_roots_time:
+ type: timing_distribution
+ time_unit: microsecond
+ gecko_datapoint: GC_MARK_ROOTS_US
+ description: >
+ The time spent marking GC roots.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ mark_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GC_MARK_MS
+ description: >
+ The time spent in the mark phase.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ sweep_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GC_SWEEP_MS
+ description: >
+ The time spent in the sweep phase.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ compact_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GC_COMPACT_MS
+ description: >
+ The time spent in the compact phase.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+ slice_time:
+ type: timing_distribution
+ time_unit: millisecond
+ gecko_datapoint: GC_SLICE_MS
+ description: >
+ The time spent running a GC slice.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1636419#c17
+ notification_emails:
+ - dev-telemetry-gc-alerts@mozilla.org
+ - jcoppeard@mozilla.com
+ expires: never
+
+media.audio:
+ init_failure:
+ type: labeled_counter
+ labels:
+ - first
+ - other
+ gecko_datapoint: MEDIA_AUDIO_INIT_FAILURE
+ description: >
+ Failure occurs when initializing the audio stream.
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671714
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671714#c10
+ notification_emails:
+ - padenot@mozilla.com
+ - kinetik@flim.org
+ - cchang@mozilla.com
+ expires: never
+
+ backend:
+ type: labeled_counter
+ labels:
+ - unknown
+ - audiounit
+ - audiounit_rust
+ - aaudio
+ - opensl
+ - wasapi
+ - winmm
+ - alsa
+ - jack
+ - oss
+ - pulse
+ - pulse_rust
+ - sndio
+ - sun
+ gecko_datapoint: MEDIA_AUDIO_BACKEND
+ description: >
+ The operating system audio backend
+ bugs:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671714
+ data_reviews:
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1671714#c10
+ notification_emails:
+ - padenot@mozilla.com
+ - kinetik@flim.org
+ - cchang@mozilla.com
+ expires: never