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
|
telemetry_mirror: GFX_HDR_WINDOWS_DISPLAY_COLORSPACE_BITFIELD
|
||||||
no_lint:
|
no_lint:
|
||||||
- UNIT_IN_NAME
|
- 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/ProfilerLabels.h"
|
||||||
#include "mozilla/Sprintf.h"
|
#include "mozilla/Sprintf.h"
|
||||||
#include "mozilla/StaticPrefs_gfx.h"
|
#include "mozilla/StaticPrefs_gfx.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
|
|
||||||
#include "nsAppDirectoryServiceDefs.h"
|
#include "nsAppDirectoryServiceDefs.h"
|
||||||
#include "nsCharTraits.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
|
// We activate bundled fonts if the pref is > 0 (on) or < 0 (auto), only an
|
||||||
// explicit value of 0 (off) will disable them.
|
// explicit value of 0 (off) will disable them.
|
||||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||||
TimeStamp start = TimeStamp::Now();
|
auto timerId = glean::fontlist::bundledfonts_activate.Start();
|
||||||
ActivateBundledFonts();
|
ActivateBundledFonts();
|
||||||
TimeStamp end = TimeStamp::Now();
|
glean::fontlist::bundledfonts_activate.StopAndAccumulate(
|
||||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
std::move(timerId));
|
||||||
(end - start).ToMilliseconds());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1161,7 +1160,7 @@ nsresult CoreTextFontList::InitFontListForPlatform() {
|
|||||||
// Here, we need to wait until it has finished its work.
|
// Here, we need to wait until it has finished its work.
|
||||||
gfxPlatformMac::WaitForFontRegistration();
|
gfxPlatformMac::WaitForFontRegistration();
|
||||||
|
|
||||||
Telemetry::AutoTimer<Telemetry::MAC_INITFONTLIST_TOTAL> timer;
|
auto timer = glean::fontlist::mac_init_total.Measure();
|
||||||
|
|
||||||
InitSystemFontNames();
|
InitSystemFontNames();
|
||||||
|
|
||||||
@@ -1409,7 +1408,10 @@ gfxFontEntry* CoreTextFontList::PlatformGlobalFontFallback(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cantUseFallbackFont) {
|
if (cantUseFallbackFont) {
|
||||||
Telemetry::Accumulate(Telemetry::BAD_FALLBACK_FONT, cantUseFallbackFont);
|
glean::fontlist::bad_fallback_font
|
||||||
|
.EnumGet(static_cast<glean::fontlist::BadFallbackFontLabel>(
|
||||||
|
cantUseFallbackFont))
|
||||||
|
.Add();
|
||||||
}
|
}
|
||||||
|
|
||||||
CFRelease(str);
|
CFRelease(str);
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include "mozilla/ProfilerLabels.h"
|
#include "mozilla/ProfilerLabels.h"
|
||||||
#include "mozilla/Sprintf.h"
|
#include "mozilla/Sprintf.h"
|
||||||
#include "mozilla/StaticPrefs_gfx.h"
|
#include "mozilla/StaticPrefs_gfx.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
#include "mozilla/WindowsProcessMitigations.h"
|
#include "mozilla/WindowsProcessMitigations.h"
|
||||||
#include "mozilla/WindowsVersion.h"
|
#include "mozilla/WindowsVersion.h"
|
||||||
#include "nsDirectoryServiceUtils.h"
|
#include "nsDirectoryServiceUtils.h"
|
||||||
@@ -1580,7 +1580,7 @@ void gfxDWriteFontList::InitSharedFontListForPlatform() {
|
|||||||
RefPtr<IDWriteFactory> factory = Factory::GetDWriteFactory();
|
RefPtr<IDWriteFactory> factory = Factory::GetDWriteFactory();
|
||||||
HRESULT hr = factory->GetGdiInterop(getter_AddRefs(mGDIInterop));
|
HRESULT hr = factory->GetGdiInterop(getter_AddRefs(mGDIInterop));
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||||
uint32_t(errGDIInterop));
|
uint32_t(errGDIInterop));
|
||||||
mSharedFontList.reset(nullptr);
|
mSharedFontList.reset(nullptr);
|
||||||
return;
|
return;
|
||||||
@@ -1589,7 +1589,7 @@ void gfxDWriteFontList::InitSharedFontListForPlatform() {
|
|||||||
mSystemFonts = Factory::GetDWriteSystemFonts(true);
|
mSystemFonts = Factory::GetDWriteSystemFonts(true);
|
||||||
NS_ASSERTION(mSystemFonts != nullptr, "GetSystemFontCollection failed!");
|
NS_ASSERTION(mSystemFonts != nullptr, "GetSystemFontCollection failed!");
|
||||||
if (!mSystemFonts) {
|
if (!mSystemFonts) {
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||||
uint32_t(errSystemFontCollection));
|
uint32_t(errSystemFontCollection));
|
||||||
mSharedFontList.reset(nullptr);
|
mSharedFontList.reset(nullptr);
|
||||||
return;
|
return;
|
||||||
@@ -1625,9 +1625,8 @@ void gfxDWriteFontList::InitSharedFontListForPlatform() {
|
|||||||
TimeStamp start2 = TimeStamp::Now();
|
TimeStamp start2 = TimeStamp::Now();
|
||||||
AppendFamiliesFromCollection(mBundledFonts, families);
|
AppendFamiliesFromCollection(mBundledFonts, families);
|
||||||
TimeStamp end2 = TimeStamp::Now();
|
TimeStamp end2 = TimeStamp::Now();
|
||||||
Telemetry::Accumulate(
|
glean::fontlist::bundledfonts_activate.AccumulateRawDuration(
|
||||||
Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
(end1 - start1) + (end2 - start2));
|
||||||
(end1 - start1).ToMilliseconds() + (end2 - start2).ToMilliseconds());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
SharedFontList()->SetFamilyNames(families);
|
SharedFontList()->SetFamilyNames(families);
|
||||||
@@ -1668,7 +1667,7 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
|||||||
|
|
||||||
hr = factory->GetGdiInterop(getter_AddRefs(mGDIInterop));
|
hr = factory->GetGdiInterop(getter_AddRefs(mGDIInterop));
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||||
uint32_t(errGDIInterop));
|
uint32_t(errGDIInterop));
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -1679,7 +1678,7 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
|||||||
NS_ASSERTION(mSystemFonts != nullptr, "GetSystemFontCollection failed!");
|
NS_ASSERTION(mSystemFonts != nullptr, "GetSystemFontCollection failed!");
|
||||||
|
|
||||||
if (!mSystemFonts) {
|
if (!mSystemFonts) {
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||||
uint32_t(errSystemFontCollection));
|
uint32_t(errSystemFontCollection));
|
||||||
return NS_ERROR_FAILURE;
|
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
|
// We activate bundled fonts if the pref is > 0 (on) or < 0 (auto), only an
|
||||||
// explicit value of 0 (off) will disable them.
|
// explicit value of 0 (off) will disable them.
|
||||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||||
TimeStamp start = TimeStamp::Now();
|
auto timerId = glean::fontlist::bundledfonts_activate.Start();
|
||||||
mBundledFonts = CreateBundledFontsCollection(factory);
|
mBundledFonts = CreateBundledFontsCollection(factory);
|
||||||
if (mBundledFonts) {
|
if (mBundledFonts) {
|
||||||
GetFontsFromCollection(mBundledFonts);
|
GetFontsFromCollection(mBundledFonts);
|
||||||
}
|
}
|
||||||
TimeStamp end = TimeStamp::Now();
|
glean::fontlist::bundledfonts_activate.StopAndAccumulate(
|
||||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
std::move(timerId));
|
||||||
(end - start).ToMilliseconds());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
const uint32_t kBundledCount = mFontFamilies.Count();
|
const uint32_t kBundledCount = mFontFamilies.Count();
|
||||||
@@ -1711,7 +1709,7 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
|||||||
NS_ASSERTION(mFontFamilies.Count() > kBundledCount,
|
NS_ASSERTION(mFontFamilies.Count() > kBundledCount,
|
||||||
"no fonts found in the system fontlist -- holy crap batman!");
|
"no fonts found in the system fontlist -- holy crap batman!");
|
||||||
if (mFontFamilies.Count() == kBundledCount) {
|
if (mFontFamilies.Count() == kBundledCount) {
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_INIT_PROBLEM,
|
glean::fontlist::dwritefont_init_problem.AccumulateSingleSample(
|
||||||
uint32_t(errNoFonts));
|
uint32_t(errNoFonts));
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
@@ -1820,9 +1818,9 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
elapsedTime = (t5.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
|
elapsedTime = (t5.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_TOTAL,
|
glean::fontlist::dwritefont_delayedinit_total.AccumulateRawDuration(
|
||||||
elapsedTime);
|
TimeDuration::FromMilliseconds(elapsedTime));
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_COUNT,
|
glean::fontlist::dwritefont_delayedinit_count.AccumulateSingleSample(
|
||||||
mSystemFonts->GetFontFamilyCount());
|
mSystemFonts->GetFontFamilyCount());
|
||||||
LOG_FONTINIT((
|
LOG_FONTINIT((
|
||||||
"(fontinit) Total time in InitFontList: %9.3f ms (families: %d, %s)\n",
|
"(fontinit) Total time in InitFontList: %9.3f ms (families: %d, %s)\n",
|
||||||
@@ -1835,8 +1833,8 @@ nsresult gfxDWriteFontList::InitFontListForPlatform() {
|
|||||||
elapsedTime));
|
elapsedTime));
|
||||||
|
|
||||||
elapsedTime = (t3.QuadPart - t2.QuadPart) * 1000.0 / frequency.QuadPart;
|
elapsedTime = (t3.QuadPart - t2.QuadPart) * 1000.0 / frequency.QuadPart;
|
||||||
Telemetry::Accumulate(Telemetry::DWRITEFONT_DELAYEDINITFONTLIST_COLLECT,
|
glean::fontlist::dwritefont_delayedinit_collect.AccumulateRawDuration(
|
||||||
elapsedTime);
|
TimeDuration::FromMilliseconds(elapsedTime));
|
||||||
LOG_FONTINIT(
|
LOG_FONTINIT(
|
||||||
("(fontinit) --- GetSystemFontCollection: %9.3f ms\n", elapsedTime));
|
("(fontinit) --- GetSystemFontCollection: %9.3f ms\n", elapsedTime));
|
||||||
|
|
||||||
@@ -2285,7 +2283,9 @@ gfxFontEntry* gfxDWriteFontList::PlatformGlobalFontFallback(
|
|||||||
aMatchedFamily = family;
|
aMatchedFamily = family;
|
||||||
return fontEntry;
|
return fontEntry;
|
||||||
}
|
}
|
||||||
Telemetry::Accumulate(Telemetry::BAD_FALLBACK_FONT, true);
|
glean::fontlist::bad_fallback_font
|
||||||
|
.EnumGet(glean::fontlist::BadFallbackFontLabel::eTrue)
|
||||||
|
.Add();
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
#include "mozilla/EndianUtils.h"
|
#include "mozilla/EndianUtils.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/scache/StartupCache.h"
|
#include "mozilla/scache/StartupCache.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -1618,11 +1618,8 @@ void gfxFT2FontList::FindFonts() {
|
|||||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() > 0 ||
|
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() > 0 ||
|
||||||
(StaticPrefs::gfx_bundled_fonts_activate_AtStartup() < 0 &&
|
(StaticPrefs::gfx_bundled_fonts_activate_AtStartup() < 0 &&
|
||||||
!nsMemory::IsLowMemoryPlatform())) {
|
!nsMemory::IsLowMemoryPlatform())) {
|
||||||
TimeStamp start = TimeStamp::Now();
|
auto timer = glean::fontlist::bundledfonts_activate.Measure();
|
||||||
FindFontsInOmnijar(mFontNameCache.get());
|
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.
|
// Look for downloaded fonts in a profile-agnostic "fonts" directory.
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Sprintf.h"
|
#include "mozilla/Sprintf.h"
|
||||||
#include "mozilla/StaticPrefs_gfx.h"
|
#include "mozilla/StaticPrefs_gfx.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
#include "mozilla/TimeStamp.h"
|
#include "mozilla/TimeStamp.h"
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsIConsoleService.h"
|
#include "nsIConsoleService.h"
|
||||||
@@ -1758,11 +1758,10 @@ void gfxFcPlatformFontList::InitSharedFontListForPlatform() {
|
|||||||
|
|
||||||
#ifdef MOZ_BUNDLED_FONTS
|
#ifdef MOZ_BUNDLED_FONTS
|
||||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||||
TimeStamp start = TimeStamp::Now();
|
auto timerId = glean::fontlist::bundledfonts_activate.Start();
|
||||||
ActivateBundledFonts();
|
ActivateBundledFonts();
|
||||||
TimeStamp end = TimeStamp::Now();
|
glean::fontlist::bundledfonts_activate.StopAndAccumulate(
|
||||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
std::move(timerId));
|
||||||
(end - start).ToMilliseconds());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
#include "mozilla/MemoryReporting.h"
|
#include "mozilla/MemoryReporting.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
#include "gfxMathTable.h"
|
#include "gfxMathTable.h"
|
||||||
#include "gfxSVGGlyphs.h"
|
#include "gfxSVGGlyphs.h"
|
||||||
#include "gfx2DGlue.h"
|
#include "gfx2DGlue.h"
|
||||||
@@ -235,7 +235,10 @@ already_AddRefed<gfxFont> gfxFontCache::Lookup(
|
|||||||
Key key(aFontEntry, aStyle, aUnicodeRangeMap);
|
Key key(aFontEntry, aStyle, aUnicodeRangeMap);
|
||||||
HashEntry* entry = mFonts.GetEntry(key);
|
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) {
|
if (!entry) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "mozilla/MemoryReporting.h"
|
#include "mozilla/MemoryReporting.h"
|
||||||
#include "mozilla/ProfilerLabels.h"
|
#include "mozilla/ProfilerLabels.h"
|
||||||
#include "mozilla/StaticPrefs_gfx.h"
|
#include "mozilla/StaticPrefs_gfx.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
|
|
||||||
#include <usp10.h>
|
#include <usp10.h>
|
||||||
|
|
||||||
@@ -511,11 +511,8 @@ void GDIFontFamily::FindStyleVariationsLocked(FontInfoData* aFontInfoData) {
|
|||||||
gfxGDIFontList::gfxGDIFontList() : mFontSubstitutes(32) {
|
gfxGDIFontList::gfxGDIFontList() : mFontSubstitutes(32) {
|
||||||
#ifdef MOZ_BUNDLED_FONTS
|
#ifdef MOZ_BUNDLED_FONTS
|
||||||
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
if (StaticPrefs::gfx_bundled_fonts_activate_AtStartup() != 0) {
|
||||||
TimeStamp start = TimeStamp::Now();
|
auto timer = glean::fontlist::bundledfonts_activate.Measure();
|
||||||
ActivateBundledFonts();
|
ActivateBundledFonts();
|
||||||
TimeStamp end = TimeStamp::Now();
|
|
||||||
Telemetry::Accumulate(Telemetry::FONTLIST_BUNDLEDFONTS_ACTIVATE,
|
|
||||||
(end - start).ToMilliseconds());
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -595,7 +592,7 @@ nsresult gfxGDIFontList::GetFontSubstitutes() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult gfxGDIFontList::InitFontListForPlatform() {
|
nsresult gfxGDIFontList::InitFontListForPlatform() {
|
||||||
Telemetry::AutoTimer<Telemetry::GDI_INITFONTLIST_TOTAL> timer;
|
auto timer = glean::fontlist::gdi_init_total.Measure();
|
||||||
|
|
||||||
mFontSubstitutes.Clear();
|
mFontSubstitutes.Clear();
|
||||||
mNonExistingFonts.Clear();
|
mNonExistingFonts.Clear();
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/StaticPrefs_gfx.h"
|
#include "mozilla/StaticPrefs_gfx.h"
|
||||||
#include "mozilla/StaticPrefs_layout.h"
|
#include "mozilla/StaticPrefs_layout.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/glean/GfxMetrics.h"
|
||||||
#include "mozilla/TimeStamp.h"
|
#include "mozilla/TimeStamp.h"
|
||||||
#include "mozilla/dom/BlobImpl.h"
|
#include "mozilla/dom/BlobImpl.h"
|
||||||
#include "mozilla/dom/ContentChild.h"
|
#include "mozilla/dom/ContentChild.h"
|
||||||
@@ -837,11 +837,9 @@ gfxFontEntry* gfxPlatformFontList::SearchFamiliesForFaceName(
|
|||||||
|
|
||||||
lookup = FindFaceName(aFaceName);
|
lookup = FindFaceName(aFaceName);
|
||||||
|
|
||||||
TimeStamp end = TimeStamp::Now();
|
TimeDuration elapsed = TimeStamp::Now() - start;
|
||||||
Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITFACENAMELISTS, start,
|
glean::fontlist::initfacenamelists.AccumulateRawDuration(elapsed);
|
||||||
end);
|
|
||||||
if (LOG_FONTINIT_ENABLED()) {
|
if (LOG_FONTINIT_ENABLED()) {
|
||||||
TimeDuration elapsed = end - start;
|
|
||||||
LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s",
|
LOG_FONTINIT(("(fontinit) SearchFamiliesForFaceName took %8.2f ms %s %s",
|
||||||
elapsed.ToMilliseconds(), (lookup ? "found name" : ""),
|
elapsed.ToMilliseconds(), (lookup ? "found name" : ""),
|
||||||
(timedOut ? "timeout" : "")));
|
(timedOut ? "timeout" : "")));
|
||||||
@@ -1168,18 +1166,12 @@ already_AddRefed<gfxFont> gfxPlatformFontList::SystemFindFontForChar(
|
|||||||
|
|
||||||
// track system fallback time
|
// track system fallback time
|
||||||
static bool first = true;
|
static bool first = true;
|
||||||
int32_t intElapsed =
|
if (first)
|
||||||
int32_t(first ? elapsed.ToMilliseconds() : elapsed.ToMicroseconds());
|
glean::fontlist::system_font_fallback_first.AccumulateRawDuration(elapsed);
|
||||||
Telemetry::Accumulate((first ? Telemetry::SYSTEM_FONT_FALLBACK_FIRST
|
else
|
||||||
: Telemetry::SYSTEM_FONT_FALLBACK),
|
glean::fontlist::system_font_fallback.AccumulateRawDuration(elapsed);
|
||||||
intElapsed);
|
|
||||||
first = false;
|
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();
|
return font.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3050,12 +3042,10 @@ void gfxPlatformFontList::InitOtherFamilyNamesInternal(
|
|||||||
mOtherFamilyNamesInitialized = true;
|
mOtherFamilyNamesInitialized = true;
|
||||||
CancelInitOtherFamilyNamesTask();
|
CancelInitOtherFamilyNamesTask();
|
||||||
}
|
}
|
||||||
TimeStamp end = TimeStamp::Now();
|
TimeDuration elapsed = TimeStamp::Now() - start;
|
||||||
Telemetry::AccumulateTimeDelta(Telemetry::FONTLIST_INITOTHERFAMILYNAMES,
|
glean::fontlist::initotherfamilynames.AccumulateRawDuration(elapsed);
|
||||||
start, end);
|
|
||||||
|
|
||||||
if (LOG_FONTINIT_ENABLED()) {
|
if (LOG_FONTINIT_ENABLED()) {
|
||||||
TimeDuration elapsed = end - start;
|
|
||||||
LOG_FONTINIT(("(fontinit) InitOtherFamilyNames took %8.2f ms %s",
|
LOG_FONTINIT(("(fontinit) InitOtherFamilyNames took %8.2f ms %s",
|
||||||
elapsed.ToMilliseconds(), (timedOut ? "timeout" : "")));
|
elapsed.ToMilliseconds(), (timedOut ? "timeout" : "")));
|
||||||
}
|
}
|
||||||
@@ -3077,12 +3067,11 @@ void gfxPlatformFontList::InitOtherFamilyNamesInternal(
|
|||||||
mOtherFamilyNamesInitialized = true;
|
mOtherFamilyNamesInitialized = true;
|
||||||
CancelInitOtherFamilyNamesTask();
|
CancelInitOtherFamilyNamesTask();
|
||||||
|
|
||||||
TimeStamp end = TimeStamp::Now();
|
TimeDuration elapsed = TimeStamp::Now() - start;
|
||||||
Telemetry::AccumulateTimeDelta(
|
glean::fontlist::initotherfamilynames_no_deferring.AccumulateRawDuration(
|
||||||
Telemetry::FONTLIST_INITOTHERFAMILYNAMES_NO_DEFERRING, start, end);
|
elapsed);
|
||||||
|
|
||||||
if (LOG_FONTINIT_ENABLED()) {
|
if (LOG_FONTINIT_ENABLED()) {
|
||||||
TimeDuration elapsed = end - start;
|
|
||||||
LOG_FONTINIT(
|
LOG_FONTINIT(
|
||||||
("(fontinit) InitOtherFamilyNames without deferring took %8.2f ms",
|
("(fontinit) InitOtherFamilyNames without deferring took %8.2f ms",
|
||||||
elapsed.ToMilliseconds()));
|
elapsed.ToMilliseconds()));
|
||||||
|
|||||||
Reference in New Issue
Block a user