Skip to content

Commit 4a0a5a0

Browse files
Bug 1875170 - Migrate metrics in the gfx namespace collected via GeckoView Streaming to pure glean r=chutten,gfx-reviewers,jnicol
GVST is how these probes sent data in Fenix and is now unnecessary (and doesn't send data in Fenix release) since Firefox Desktop has direct access to Glean. We therefore need to clean them up in some capacity. Following the recommendations from the GeckoView Streaming (GVST) validation effort, this is a pure Glean api implementation of the metrics that fell under gfx and its subcategories in geckoview streaming. Each metric retains its previous name, and gains a Glean Interface for FireFox Telemetry (GIFFT) version, such that downstream data analyses will not be impacted. Differential Revision: https://phabricator.services.mozilla.com/D198872
1 parent 05889cd commit 4a0a5a0

File tree

12 files changed

+751
-970
lines changed

12 files changed

+751
-970
lines changed

gfx/layers/apz/src/AsyncPanZoomController.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,11 @@
4141
#include "mozilla/ServoStyleConsts.h" // for StyleComputedTimingFunction
4242
#include "mozilla/EventForwards.h" // for nsEventStatus_*
4343
#include "mozilla/EventStateManager.h" // for EventStateManager
44-
#include "mozilla/MouseEvents.h" // for WidgetWheelEvent
45-
#include "mozilla/Preferences.h" // for Preferences
46-
#include "mozilla/RecursiveMutex.h" // for RecursiveMutexAutoLock, etc
47-
#include "mozilla/RefPtr.h" // for RefPtr
44+
#include "mozilla/glean/GleanMetrics.h"
45+
#include "mozilla/MouseEvents.h" // for WidgetWheelEvent
46+
#include "mozilla/Preferences.h" // for Preferences
47+
#include "mozilla/RecursiveMutex.h" // for RecursiveMutexAutoLock, etc
48+
#include "mozilla/RefPtr.h" // for RefPtr
4849
#include "mozilla/ScrollTypes.h"
4950
#include "mozilla/StaticPrefs_apz.h"
5051
#include "mozilla/StaticPrefs_general.h"
@@ -5288,13 +5289,12 @@ void AsyncPanZoomController::UpdateCheckerboardEvent(
52885289
const MutexAutoLock& aProofOfLock, uint32_t aMagnitude) {
52895290
if (mCheckerboardEvent && mCheckerboardEvent->RecordFrameInfo(aMagnitude)) {
52905291
// This checkerboard event is done. Report some metrics to telemetry.
5291-
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_SEVERITY,
5292-
mCheckerboardEvent->GetSeverity());
5293-
mozilla::Telemetry::Accumulate(mozilla::Telemetry::CHECKERBOARD_PEAK,
5294-
mCheckerboardEvent->GetPeak());
5295-
mozilla::Telemetry::Accumulate(
5296-
mozilla::Telemetry::CHECKERBOARD_DURATION,
5297-
(uint32_t)mCheckerboardEvent->GetDuration().ToMilliseconds());
5292+
mozilla::glean::gfx_checkerboard::severity.AccumulateSamples(
5293+
{mCheckerboardEvent->GetSeverity()});
5294+
mozilla::glean::gfx_checkerboard::peak_pixel_count.AccumulateSamples(
5295+
{mCheckerboardEvent->GetPeak()});
5296+
mozilla::glean::gfx_checkerboard::duration.AccumulateRawDuration(
5297+
mCheckerboardEvent->GetDuration());
52985298

52995299
// mCheckerboardEvent only gets created if we are supposed to record
53005300
// telemetry so we always pass true for aRecordTelemetry.

gfx/layers/apz/src/PotentialCheckerboardDurationTracker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66

77
#include "PotentialCheckerboardDurationTracker.h"
88

9-
#include "mozilla/Telemetry.h" // for Telemetry
9+
#include "mozilla/Telemetry.h" // for Telemetry
10+
#include "mozilla/glean/GleanMetrics.h" // for Glean telemetry
1011

1112
namespace mozilla {
1213
namespace layers {
@@ -28,9 +29,8 @@ void PotentialCheckerboardDurationTracker::CheckerboardDone(
2829
mInCheckerboard = false;
2930
if (!Tracking()) {
3031
if (aRecordTelemetry) {
31-
mozilla::Telemetry::AccumulateTimeDelta(
32-
mozilla::Telemetry::CHECKERBOARD_POTENTIAL_DURATION,
33-
mCurrentPeriodStart);
32+
mozilla::glean::gfx_checkerboard::potential_duration
33+
.AccumulateRawDuration(mCurrentPeriodStart - TimeStamp::Now());
3434
}
3535
}
3636
}

gfx/layers/ipc/CompositorBridgeParent.cpp

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
#include "mozilla/ProfilerLabels.h"
6464
#include "mozilla/ProfilerMarkers.h"
6565
#include "mozilla/Telemetry.h"
66+
#include "mozilla/glean/GleanMetrics.h"
6667
#include "nsCOMPtr.h" // for already_AddRefed
6768
#include "nsDebug.h" // for NS_ASSERTION, etc
6869
#include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc
@@ -1776,18 +1777,20 @@ int32_t RecordContentFrameTime(
17761777
ContentFrameMarker{});
17771778
}
17781779

1779-
Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME, fracLatencyNorm);
1780+
mozilla::glean::gfx_content_frame_time::from_paint.AccumulateSamples(
1781+
{static_cast<unsigned long long>(fracLatencyNorm)});
17801782

17811783
if (!(aTxnId == VsyncId()) && aVsyncStart) {
17821784
latencyMs = (aCompositeEnd - aVsyncStart).ToMilliseconds();
17831785
latencyNorm = latencyMs / aVsyncRate.ToMilliseconds();
17841786
fracLatencyNorm = lround(latencyNorm * 100.0);
17851787
int32_t result = fracLatencyNorm;
1786-
Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME_VSYNC, fracLatencyNorm);
1788+
mozilla::glean::gfx_content_frame_time::from_vsync.AccumulateSamples(
1789+
{static_cast<unsigned long long>(fracLatencyNorm)});
17871790

17881791
if (aContainsSVGGroup) {
1789-
Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME_WITH_SVG,
1790-
fracLatencyNorm);
1792+
mozilla::glean::gfx_content_frame_time::with_svg.AccumulateSamples(
1793+
{static_cast<unsigned long long>(fracLatencyNorm)});
17911794
}
17921795

17931796
// Record CONTENT_FRAME_TIME_REASON.
@@ -1819,35 +1822,63 @@ int32_t RecordContentFrameTime(
18191822
// Success
18201823
Telemetry::AccumulateCategorical(
18211824
LABELS_CONTENT_FRAME_TIME_REASON::OnTime);
1825+
mozilla::glean::gfx_content_frame_time::reason
1826+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::eOnTime)
1827+
.Add();
18221828
} else {
18231829
if (aCompositeId == VsyncId()) {
18241830
// aCompositeId is 0, possibly something got trigged from
18251831
// outside vsync?
18261832
Telemetry::AccumulateCategorical(
18271833
LABELS_CONTENT_FRAME_TIME_REASON::NoVsyncNoId);
1834+
mozilla::glean::gfx_content_frame_time::reason
1835+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::eNoVsyncNoId)
1836+
.Add();
18281837
} else if (aTxnId >= aCompositeId) {
18291838
// Vsync ids are nonsensical, maybe we're trying to catch up?
18301839
Telemetry::AccumulateCategorical(
18311840
LABELS_CONTENT_FRAME_TIME_REASON::NoVsync);
1841+
mozilla::glean::gfx_content_frame_time::reason
1842+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::eNoVsync)
1843+
.Add();
18321844
} else if (aCompositeId - aTxnId > 1) {
18331845
// Composite started late (and maybe took too long as well)
18341846
if (aFullPaintTime >= TimeDuration::FromMilliseconds(20)) {
18351847
Telemetry::AccumulateCategorical(
18361848
LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeLong);
1849+
mozilla::glean::gfx_content_frame_time::reason
1850+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::
1851+
eMissedCompositeLong)
1852+
.Add();
18371853
} else if (aFullPaintTime >= TimeDuration::FromMilliseconds(10)) {
18381854
Telemetry::AccumulateCategorical(
18391855
LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeMid);
1856+
mozilla::glean::gfx_content_frame_time::reason
1857+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::
1858+
eMissedCompositeMid)
1859+
.Add();
18401860
} else if (aFullPaintTime >= TimeDuration::FromMilliseconds(5)) {
18411861
Telemetry::AccumulateCategorical(
18421862
LABELS_CONTENT_FRAME_TIME_REASON::MissedCompositeLow);
1863+
mozilla::glean::gfx_content_frame_time::reason
1864+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::
1865+
eMissedCompositeLow)
1866+
.Add();
18431867
} else {
18441868
Telemetry::AccumulateCategorical(
18451869
LABELS_CONTENT_FRAME_TIME_REASON::MissedComposite);
1870+
mozilla::glean::gfx_content_frame_time::reason
1871+
.EnumGet(
1872+
glean::gfx_content_frame_time::ReasonLabel::eMissedComposite)
1873+
.Add();
18461874
}
18471875
} else {
18481876
// Composite started on time, but must have taken too long.
18491877
Telemetry::AccumulateCategorical(
18501878
LABELS_CONTENT_FRAME_TIME_REASON::SlowComposite);
1879+
mozilla::glean::gfx_content_frame_time::reason
1880+
.EnumGet(glean::gfx_content_frame_time::ReasonLabel::eSlowComposite)
1881+
.Add();
18511882
}
18521883
}
18531884

@@ -1857,17 +1888,18 @@ int32_t RecordContentFrameTime(
18571888
latencyNorm = latencyMs / aVsyncRate.ToMilliseconds();
18581889
fracLatencyNorm = lround(latencyNorm * 100.0);
18591890
}
1860-
Telemetry::Accumulate(
1861-
Telemetry::CONTENT_FRAME_TIME_WITHOUT_RESOURCE_UPLOAD,
1862-
fracLatencyNorm);
1891+
mozilla::glean::gfx_content_frame_time::without_resource_upload
1892+
.AccumulateSamples(
1893+
{static_cast<unsigned long long>(fracLatencyNorm)});
18631894

18641895
if (aStats) {
18651896
latencyMs -= (double(aStats->gpu_cache_upload_time) / 1000000.0);
18661897
latencyNorm = latencyMs / aVsyncRate.ToMilliseconds();
18671898
fracLatencyNorm = lround(latencyNorm * 100.0);
18681899
}
1869-
Telemetry::Accumulate(Telemetry::CONTENT_FRAME_TIME_WITHOUT_UPLOAD,
1870-
fracLatencyNorm);
1900+
mozilla::glean::gfx_content_frame_time::without_resource_upload
1901+
.AccumulateSamples(
1902+
{static_cast<unsigned long long>(fracLatencyNorm)});
18711903
}
18721904
return result;
18731905
}
@@ -1962,9 +1994,8 @@ void RecordCompositionPayloadsPresented(
19621994
mozilla::Telemetry::KEYPRESS_PRESENT_LATENCY, payload.mTimeStamp,
19631995
presented);
19641996
} else if (payload.mType == CompositionPayloadType::eAPZScroll) {
1965-
Telemetry::AccumulateTimeDelta(
1966-
mozilla::Telemetry::SCROLL_PRESENT_LATENCY, payload.mTimeStamp,
1967-
presented);
1997+
mozilla::glean::gfx::scroll_present_latency.AccumulateRawDuration(
1998+
presented - payload.mTimeStamp);
19681999
} else if (payload.mType ==
19692000
CompositionPayloadType::eMouseUpFollowedByClick) {
19702001
Telemetry::AccumulateTimeDelta(

gfx/layers/wr/WebRenderBridgeParent.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include "mozilla/UniquePtr.h"
2323
#include "mozilla/gfx/gfxVars.h"
2424
#include "mozilla/gfx/GPUParent.h"
25+
#include "mozilla/glean/GleanMetrics.h"
2526
#include "mozilla/layers/AnimationHelper.h"
2627
#include "mozilla/layers/APZSampler.h"
2728
#include "mozilla/layers/APZUpdater.h"
@@ -200,9 +201,8 @@ class SceneBuiltNotification : public wr::NotificationHandler {
200201
MarkerTiming::Interval(startTime, endTime),
201202
ContentBuildMarker);
202203
}
203-
Telemetry::Accumulate(
204-
Telemetry::CONTENT_FULL_PAINT_TIME,
205-
static_cast<uint32_t>((endTime - startTime).ToMilliseconds()));
204+
mozilla::glean::gfx_content::full_paint_time.AccumulateRawDuration(
205+
endTime - startTime);
206206
parent->NotifySceneBuiltForEpoch(epoch, endTime);
207207
}));
208208
}

0 commit comments

Comments
 (0)