Commit 8ebf4981 authored by Jeff Muizelaar's avatar Jeff Muizelaar
Browse files

Bug 1728423 - Migrate display list building time metric to glean. r=chutten,miko

parent 8ee7f220
Loading
Loading
Loading
Loading

gfx/metrics.yaml

0 → 100644
+27 −0
Original line number Diff line number Diff line
# 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/2-0-0

paint:
  build_displaylist_time:
    type: timing_distribution
    description: >
      The time to build a Gecko display list.
    bugs:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1728423
    data_reviews:
      - https://bugzilla.mozilla.org/show_bug.cgi?id=1728423
    data_sensitivity:
      - technical
    notification_emails:
      - gfx-telemetry-alerts@mozilla.com
      - mwoodrow@mozilla.com
    expires: never
    telemetry_mirror: PAINT_BUILD_DISPLAYLIST_TIME
+3 −3
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/DisplayPortUtils.h"
#include "mozilla/GeckoBindings.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/dom/AnonymousContent.h"
#include "mozilla/dom/BrowserChild.h"
#include "mozilla/dom/CanvasUtils.h"
@@ -3136,6 +3137,7 @@ void nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
  PresShell* presShell = presContext->PresShell();

  TimeStamp startBuildDisplayList = TimeStamp::Now();
  auto dlTimerId = mozilla::glean::paint::build_displaylist_time.Start();

  const bool buildCaret = !(aFlags & PaintFrameFlags::HideCaret);

@@ -3435,9 +3437,7 @@ void nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,

  const double geckoDLBuildTime =
      (TimeStamp::Now() - startBuildDisplayList).ToMilliseconds();

  Telemetry::Accumulate(Telemetry::PAINT_BUILD_DISPLAYLIST_TIME,
                        geckoDLBuildTime);
  mozilla::glean::paint::build_displaylist_time.StopAndAccumulate(std::move(dlTimerId));

  bool consoleNeedsDisplayList =
      (gfxUtils::DumpDisplayList() || gfxEnv::DumpPaint()) &&
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ metrics_yamls = [
    "toolkit/components/glean/tests/test_metrics.yaml",
    "toolkit/mozapps/update/metrics.yaml",
    "browser/base/content/metrics.yaml",
    "gfx/metrics.yaml",
]

# The list of all Glean pings.yaml files, relative to the top src dir.