Bug 1935420 - Migrate histograms to use Glean APIs for fontlist, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D233847
This commit is contained in:
252
gfx/metrics.yaml
252
gfx/metrics.yaml
@@ -1041,3 +1041,255 @@ gfx.hdr:
|
||||
telemetry_mirror: GFX_HDR_WINDOWS_DISPLAY_COLORSPACE_BITFIELD
|
||||
no_lint:
|
||||
- UNIT_IN_NAME
|
||||
|
||||
fontlist:
|
||||
initotherfamilynames:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
Time(ms) spent on reading other family names from all fonts
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram FONTLIST_INITOTHERFAMILYNAMES.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: FONTLIST_INITOTHERFAMILYNAMES
|
||||
|
||||
initotherfamilynames_no_deferring:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
Time(ms) spent on reading other family names from all fonts for no timeout
|
||||
case
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING
|
||||
|
||||
initfacenamelists:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
Time(ms) spent on reading family names from all fonts
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram FONTLIST_INITFACENAMELISTS.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: FONTLIST_INITFACENAMELISTS
|
||||
|
||||
bundledfonts_activate:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
Time(ms) spent activating additional fonts bundled with the product
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram FONTLIST_BUNDLEDFONTS_ACTIVATE.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1696162
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1696162
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: FONTLIST_BUNDLEDFONTS_ACTIVATE
|
||||
|
||||
dwritefont_delayedinit_total:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
gfxDWriteFontList::DelayedInitFontList Total (ms)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram DWRITEFONT_DELAYEDINITFONTLIST_TOTAL.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: DWRITEFONT_DELAYEDINITFONTLIST_TOTAL
|
||||
|
||||
dwritefont_delayedinit_count:
|
||||
type: custom_distribution
|
||||
description: >
|
||||
gfxDWriteFontList::DelayedInitFontList Font Family Count
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram DWRITEFONT_DELAYEDINITFONTLIST_COUNT.
|
||||
range_min: 1
|
||||
range_max: 10000
|
||||
bucket_count: 10
|
||||
histogram_type: exponential
|
||||
unit: font family count
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: DWRITEFONT_DELAYEDINITFONTLIST_COUNT
|
||||
|
||||
dwritefont_delayedinit_collect:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
gfxDWriteFontList::DelayedInitFontList GetSystemFontCollection (ms)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram DWRITEFONT_DELAYEDINITFONTLIST_COLLECT.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: DWRITEFONT_DELAYEDINITFONTLIST_COLLECT
|
||||
|
||||
dwritefont_init_problem:
|
||||
type: custom_distribution
|
||||
description: >
|
||||
DirectWrite system fontlist initialization problem (1=GDI interop,
|
||||
2=system font collection, 3=no fonts)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry enumerated
|
||||
histogram DWRITEFONT_INIT_PROBLEM.
|
||||
range_min: 0
|
||||
range_max: 8
|
||||
bucket_count: 9
|
||||
histogram_type: linear
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: DWRITEFONT_INIT_PROBLEM
|
||||
|
||||
system_font_fallback:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
System font fallback (us)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram SYSTEM_FONT_FALLBACK.
|
||||
time_unit: microsecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: SYSTEM_FONT_FALLBACK
|
||||
|
||||
system_font_fallback_first:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
System font fallback, first call (ms)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram SYSTEM_FONT_FALLBACK_FIRST.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: SYSTEM_FONT_FALLBACK_FIRST
|
||||
|
||||
font_cache_hit:
|
||||
type: labeled_counter
|
||||
description: >
|
||||
font cache hit
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry boolean
|
||||
histogram FONT_CACHE_HIT.
|
||||
labels:
|
||||
- "false"
|
||||
- "true"
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: h#FONT_CACHE_HIT
|
||||
|
||||
bad_fallback_font:
|
||||
type: labeled_counter
|
||||
description: >
|
||||
system fallback font can't be used
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry boolean
|
||||
histogram BAD_FALLBACK_FONT.
|
||||
labels:
|
||||
- "false"
|
||||
- "true"
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: h#BAD_FALLBACK_FONT
|
||||
|
||||
gdi_init_total:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
gfxGDIFontList::InitFontList Total (ms)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram GDI_INITFONTLIST_TOTAL.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: GDI_INITFONTLIST_TOTAL
|
||||
|
||||
mac_init_total:
|
||||
type: timing_distribution
|
||||
description: >
|
||||
gfxMacPlatformFontList::InitFontList Total (ms)
|
||||
|
||||
This metric was generated to correspond to the Legacy Telemetry
|
||||
exponential histogram MAC_INITFONTLIST_TOTAL.
|
||||
time_unit: millisecond
|
||||
bugs:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
data_reviews:
|
||||
- https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
|
||||
notification_emails:
|
||||
- gfx-telemetry-alerts@mozilla.com
|
||||
expires: never
|
||||
telemetry_mirror: MAC_INITFONTLIST_TOTAL
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "mozilla/ProfilerLabels.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs_gfx.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsCharTraits.h"
|
||||
@@ -1009,11 +1009,10 @@ CoreTextFontList::CoreTextFontList()
|
||||
// We activate bundled fonts if the pref is > 0 (on) or < 0 (auto), only an
|
||||
// explicit value of 0 (off) will disable them.
|
||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
auto timerId = glean::fontlist::bundledfonts_activate.Start();
|
||||
ActivateBundledFonts();
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
||||
(end - start).ToMilliseconds());
|
||||
glean::fontlist::bundledfonts_activate.StopAndAccumulate(
|
||||
std::move(timerId));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1161,7 +1160,7 @@ nsresult CoreTextFontList::InitFontListForPlatform() {
|
||||
// Here, we need to wait until it has finished its work.
|
||||
gfxPlatformMac::WaitForFontRegistration();
|
||||
|
||||
Telemetry::AutoTimer<Telemetry::MAC_INITFONTLIST_TOTAL> timer;
|
||||
auto timer = glean::fontlist::mac_init_total.Measure();
|
||||
|
||||
InitSystemFontNames();
|
||||
|
||||
@@ -1409,7 +1408,10 @@ gfxFontEntry* CoreTextFontList::PlatformGlobalFontFallback(
|
||||
}
|
||||
|
||||
if (cantUseFallbackFont) {
|
||||
Telemetry::Accumulate(Telemetry::BAD_FALLBACK_FONT, cantUseFallbackFont);
|
||||
glean::fontlist::bad_fallback_font
|
||||
.EnumGet(static_cast<glean::fontlist::BadFallbackFontLabel>(
|
||||
cantUseFallbackFont))
|
||||
.Add();
|
||||
}
|
||||
|
||||
CFRelease(str);
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "mozilla/ProfilerLabels.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs_gfx.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
#include "mozilla/WindowsProcessMitigations.h"
|
||||
#include "mozilla/WindowsVersion.h"
|
||||
#include "nsDirectoryServiceUtils.h"
|
||||
@@ -1580,8 +1580,8 @@ void gfxDWriteFontList::InitSharedFontListForPlatform() {
|
||||
RefPtr<IDWriteFactory> factory = Factory::GetDWriteFactory();
|
||||
HRESULT hr = factory->GetGdiInterop(getter_AddRefs(mGDIInterop));
|
||||
if (FAILED(hr)) {
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
||||
uint32_t(errGDIInterop));
|
||||
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||
uint32_t(errGDIInterop));
|
||||
mSharedFontList.reset(nullptr);
|
||||
return;
|
||||
}
|
||||
@@ -1589,8 +1589,8 @@ void gfxDWriteFontList::InitSharedFontListForPlatform() {
|
||||
mSystemFonts = Factory::GetDWriteSystemFonts(true);
|
||||
NS_ASSERTION(mSystemFonts != nullptr, "GetSystemFontCollection failed!");
|
||||
if (!mSystemFonts) {
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
||||
uint32_t(errSystemFontCollection));
|
||||
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||
uint32_t(errSystemFontCollection));
|
||||
mSharedFontList.reset(nullptr);
|
||||
return;
|
||||
}
|
||||
@@ -1625,9 +1625,8 @@ void gfxDWriteFontList::InitSharedFontListForPlatform() {
|
||||
TimeStamp start2 = TimeStamp::Now();
|
||||
AppendFamiliesFromCollection(mBundledFonts, families);
|
||||
TimeStamp end2 = TimeStamp::Now();
|
||||
Telemetry::Accumulate(
|
||||
Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
||||
(end1 - start1).ToMilliseconds() + (end2 - start2).ToMilliseconds());
|
||||
glean::fontlist::bundledfonts_activate.AccumulateRawDuration(
|
||||
(end1 - start1) + (end2 - start2));
|
||||
}
|
||||
#endif
|
||||
SharedFontList()->SetFamilyNames(families);
|
||||
@@ -1668,8 +1667,8 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
||||
|
||||
hr = factory->GetGdiInterop(getter_AddRefs(mGDIInterop));
|
||||
if (FAILED(hr)) {
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
||||
uint32_t(errGDIInterop));
|
||||
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||
uint32_t(errGDIInterop));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1679,8 +1678,8 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
||||
NS_ASSERTION(mSystemFonts != nullptr, "GetSystemFontCollection failed!");
|
||||
|
||||
if (!mSystemFonts) {
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
||||
uint32_t(errSystemFontCollection));
|
||||
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||
uint32_t(errSystemFontCollection));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1691,14 +1690,13 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
||||
// We activate bundled fonts if the pref is > 0 (on) or < 0 (auto), only an
|
||||
// explicit value of 0 (off) will disable them.
|
||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
auto timerId = glean::fontlist::bundledfonts_activate.Start();
|
||||
mBundledFonts = CreateBundledFontsCollection(factory);
|
||||
if (mBundledFonts) {
|
||||
GetFontsFromCollection(mBundledFonts);
|
||||
}
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
||||
(end - start).ToMilliseconds());
|
||||
glean::fontlist::bundledfonts_activate.StopAndAccumulate(
|
||||
std::move(timerId));
|
||||
}
|
||||
#endif
|
||||
const uint32_t kBundledCount = mFontFamilies.Count();
|
||||
@@ -1711,8 +1709,8 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
||||
NS_ASSERTION(mFontFamilies.Count() > kBundledCount,
|
||||
"no fonts found in the system fontlist -- holy crap batman!");
|
||||
if (mFontFamilies.Count() == kBundledCount) {
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
||||
uint32_t(errNoFonts));
|
||||
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||
uint32_t(errNoFonts));
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1820,10 +1818,10 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
||||
}
|
||||
|
||||
elapsedTime = (t5.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_TOTAL,
|
||||
elapsedTime);
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_COUNT,
|
||||
mSystemFonts->GetFontFamilyCount());
|
||||
glean::fontlist::dwritefont_delayedinit_total.AccumulateRawDuration(
|
||||
TimeDuration::FromMilliseconds(elapsedTime));
|
||||
glean::fontlist::dwritefont_delayedinit_count.AccumulateSingleSample(
|
||||
mSystemFonts->GetFontFamilyCount());
|
||||
LOG_FONTINIT((
|
||||
"(fontinit) Total time in InitFontList: %9.3f ms (families: %d, %s)\n",
|
||||
elapsedTime, mSystemFonts->GetFontFamilyCount(),
|
||||
@@ -1835,8 +1833,8 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
||||
elapsedTime));
|
||||
|
||||
elapsedTime = (t3.QuadPart - t2.QuadPart) * 1000.0 / frequency.QuadPart;
|
||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_COLLECT,
|
||||
elapsedTime);
|
||||
glean::fontlist::dwritefont_delayedinit_collect.AccumulateRawDuration(
|
||||
TimeDuration::FromMilliseconds(elapsedTime));
|
||||
LOG_FONTINIT(
|
||||
("(fontinit) --- GetSystemFontCollection: %9.3f ms\n", elapsedTime));
|
||||
|
||||
@@ -2285,7 +2283,9 @@ gfxFontEntry* gfxDWriteFontList::PlatformGlobalFontFallback(
|
||||
aMatchedFamily = family;
|
||||
return fontEntry;
|
||||
}
|
||||
Telemetry::Accumulate(Telemetry::BAD_FALLBACK_FONT, true);
|
||||
glean::fontlist::bad_fallback_font
|
||||
.EnumGet(glean::fontlist::BadFallbackFontLabel::eTrue)
|
||||
.Add();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "mozilla/EndianUtils.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/scache/StartupCache.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
#include <fcntl.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -1618,11 +1618,8 @@ void gfxFT2FontList::FindFonts() {
|
||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() > 0 ||
|
||||
(StaticPrefs::gfx_bundled_fonts_activate_AtStartup() < 0 &&
|
||||
!nsMemory::IsLowMemoryPlatform())) {
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
auto timer = glean::fontlist::bundledfonts_activate.Measure();
|
||||
FindFontsInOmnijar(mFontNameCache.get());
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
||||
(end - start).ToMilliseconds());
|
||||
}
|
||||
|
||||
// Look for downloaded fonts in a profile-agnostic "fonts" directory.
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "mozilla/StaticPrefs_gfx.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIConsoleService.h"
|
||||
@@ -1758,11 +1758,10 @@ void gfxFcPlatformFontList::InitSharedFontListForPlatform() {
|
||||
|
||||
#ifdef MOZ_BUNDLED_FONTS
|
||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
auto timerId = glean::fontlist::bundledfonts_activate.Start();
|
||||
ActivateBundledFonts();
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
||||
(end - start).ToMilliseconds());
|
||||
glean::fontlist::bundledfonts_activate.StopAndAccumulate(
|
||||
std::move(timerId));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
#include "gfxMathTable.h"
|
||||
#include "gfxSVGGlyphs.h"
|
||||
#include "gfx2DGlue.h"
|
||||
@@ -235,7 +235,10 @@ already_AddRefed<gfxFont> gfxFontCache::Lookup(
|
||||
Key key(aFontEntry, aStyle, aUnicodeRangeMap);
|
||||
HashEntry* entry = mFonts.GetEntry(key);
|
||||
|
||||
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, entry != nullptr);
|
||||
glean::fontlist::font_cache_hit
|
||||
.EnumGet(
|
||||
static_cast<glean::fontlist::FontCacheHitLabel>(entry != nullptr))
|
||||
.Add();
|
||||
|
||||
if (!entry) {
|
||||
return nullptr;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/ProfilerLabels.h"
|
||||
#include "mozilla/StaticPrefs_gfx.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
|
||||
#include <usp10.h>
|
||||
|
||||
@@ -511,11 +511,8 @@ void GDIFontFamily::FindStyleVariationsLocked(FontInfoData* aFontInfoData) {
|
||||
gfxGDIFontList::gfxGDIFontList() : mFontSubstitutes(32) {
|
||||
#ifdef MOZ_BUNDLED_FONTS
|
||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||
TimeStamp start = TimeStamp::Now();
|
||||
auto timer = glean::fontlist::bundledfonts_activate.Measure();
|
||||
ActivateBundledFonts();
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
||||
(end - start).ToMilliseconds());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -595,7 +592,7 @@ nsresult gfxGDIFontList::GetFontSubstitutes() {
|
||||
}
|
||||
|
||||
nsresult gfxGDIFontList::InitFontListForPlatform() {
|
||||
Telemetry::AutoTimer<Telemetry::GDI_INITFONTLIST_TOTAL> timer;
|
||||
auto timer = glean::fontlist::gdi_init_total.Measure();
|
||||
|
||||
mFontSubstitutes.Clear();
|
||||
mNonExistingFonts.Clear();
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/StaticPrefs_gfx.h"
|
||||
#include "mozilla/StaticPrefs_layout.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/glean/GfxMetrics.h"
|
||||
#include "mozilla/TimeStamp.h"
|
||||
#include "mozilla/dom/BlobImpl.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
@@ -837,11 +837,9 @@ gfxFontEntry* gfxPlatformFontList::SearchFamiliesForFaceName(
|
||||
|
||||
lookup = FindFaceName(aFaceName);
|
||||
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITFACENAMELISTS, start,
|
||||
end);
|
||||
TimeDuration elapsed = TimeStamp::Now() - start;
|
||||
glean::fontlist::initfacenamelists.AccumulateRawDuration(elapsed);
|
||||
if (LOG_FONTINIT_ENABLED()) {
|
||||
TimeDuration elapsed = end - start;
|
||||
LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s",
|
||||
elapsed.ToMilliseconds(), (lookup ? "found name" : ""),
|
||||
(timedOut ? "timeout" : "")));
|
||||
@@ -1168,18 +1166,12 @@ already_AddRefed<gfxFont> gfxPlatformFontList::SystemFindFontForChar(
|
||||
|
||||
// track system fallback time
|
||||
static bool first = true;
|
||||
int32_t intElapsed =
|
||||
int32_t(first ? elapsed.ToMilliseconds() : elapsed.ToMicroseconds());
|
||||
Telemetry::Accumulate((first ? Telemetry::SYSTEM_FONT_FALLBACK_FIRST
|
||||
: Telemetry::SYSTEM_FONT_FALLBACK),
|
||||
intElapsed);
|
||||
if (first)
|
||||
glean::fontlist::system_font_fallback_first.AccumulateRawDuration(elapsed);
|
||||
else
|
||||
glean::fontlist::system_font_fallback.AccumulateRawDuration(elapsed);
|
||||
first = false;
|
||||
|
||||
// track the script for which fallback occurred (incremented one make it
|
||||
// 1-based)
|
||||
Telemetry::Accumulate(Telemetry::SYSTEM_FONT_FALLBACK_SCRIPT,
|
||||
int(aRunScript) + 1);
|
||||
|
||||
return font.forget();
|
||||
}
|
||||
|
||||
@@ -3050,12 +3042,10 @@ void gfxPlatformFontList::InitOtherFamilyNamesInternal(
|
||||
mOtherFamilyNamesInitialized = true;
|
||||
CancelInitOtherFamilyNamesTask();
|
||||
}
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITOTHERFAMILYNAMES,
|
||||
start, end);
|
||||
TimeDuration elapsed = TimeStamp::Now() - start;
|
||||
glean::fontlist::initotherfamilynames.AccumulateRawDuration(elapsed);
|
||||
|
||||
if (LOG_FONTINIT_ENABLED()) {
|
||||
TimeDuration elapsed = end - start;
|
||||
LOG_FONTINIT(("(fontinit) InitOtherFamilyNames took %8.2f ms %s",
|
||||
elapsed.ToMilliseconds(), (timedOut ? "timeout" : "")));
|
||||
}
|
||||
@@ -3077,12 +3067,11 @@ void gfxPlatformFontList::InitOtherFamilyNamesInternal(
|
||||
mOtherFamilyNamesInitialized = true;
|
||||
CancelInitOtherFamilyNamesTask();
|
||||
|
||||
TimeStamp end = TimeStamp::Now();
|
||||
Telemetry::AccumulateTimeDelta(
|
||||
Telemetry::FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING, start, end);
|
||||
TimeDuration elapsed = TimeStamp::Now() - start;
|
||||
glean::fontlist::initotherfamilynames_no_deferring.AccumulateRawDuration(
|
||||
elapsed);
|
||||
|
||||
if (LOG_FONTINIT_ENABLED()) {
|
||||
TimeDuration elapsed = end - start;
|
||||
LOG_FONTINIT(
|
||||
("(fontinit) InitOtherFamilyNames without deferring took %8.2f ms",
|
||||
elapsed.ToMilliseconds()));
|
||||
|
||||
Reference in New Issue
Block a user