Bug 1956726 - Migrate histograms to use Glean APIs in gfx/, r=chutten,jgilbert,firefox-desktop-core-reviewers ,mconley.

Differential Revision: https://phabricator.services.mozilla.com/D242765
This commit is contained in:
Florian Quèze
2025-04-03 13:42:51 +00:00
parent f16a35290c
commit 4b88e75c19
16 changed files with 483 additions and 75 deletions

View File

@@ -30,7 +30,7 @@
#include "mozilla/webrender/RenderTextureHost.h"
#include "mozilla/webrender/RenderThread.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/Telemetry.h"
#include "mozilla/glean/GfxMetrics.h"
#include "nsPrintfCString.h"
#include "WinUtils.h"
@@ -631,8 +631,8 @@ void DCLayerTree::CompositorEndFrame() {
mCompositionDevice->Commit();
auto end = TimeStamp::Now();
mozilla::Telemetry::Accumulate(mozilla::Telemetry::COMPOSITE_SWAP_TIME,
(end - start).ToMilliseconds() * 10.);
mozilla::glean::gfx::composite_swap_time.AccumulateSingleSample(
(end - start).ToMilliseconds() * 10.);
// Remove any framebuffers that haven't been
// used in the last 60 frames.

View File

@@ -24,7 +24,7 @@
#include "mozilla/widget/CompositorWidget.h"
#include "mozilla/widget/WinCompositorWidget.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/Telemetry.h"
#include "mozilla/glean/GfxMetrics.h"
#include "nsPrintfCString.h"
#include "FxROutputHandler.h"
@@ -528,8 +528,8 @@ RenderedFrameId RenderCompositorANGLE::EndFrame(
mSwapChain->Present(interval, flags);
}
auto end = TimeStamp::Now();
mozilla::Telemetry::Accumulate(mozilla::Telemetry::COMPOSITE_SWAP_TIME,
(end - start).ToMilliseconds() * 10.);
mozilla::glean::gfx::composite_swap_time.AccumulateSingleSample(
(end - start).ToMilliseconds() * 10.);
if (mFirstPresent && mDCLayerTree) {
// Wait for the GPU to finish executing its commands before