Bug 668893 - Sort about:memory items of type COUNT alphabetically. r=jlebar.

This commit is contained in:
Nicholas Nethercote 2011-07-07 16:37:26 +10:00
Родитель 886c1b3f2b
Коммит ea3b3b9887
5 изменённых файлов: 23 добавлений и 16 удалений

Просмотреть файл

@ -248,14 +248,21 @@ function update()
content.appendChild(div);
}
// Compare two memory reporter nodes. We want to group together measurements
// with the same units, so sort first by the nodes' _units field, then sort by
// the amount if the units are equal.
// Compare two memory reporter nodes. The primary sort is on the _units
// property. The secondary sort is on the _path property if the _units is
// UNIT_COUNT, otherwise it is on the _amount property.
function cmpAmount(a, b)
{
if (a._units != b._units)
if (a._units != b._units) {
return a._units - b._units; // use the enum order from nsIMemoryReporter
else
}
if (a._units == UNITS_COUNT) {
if (a._path < b._path)
return -1;
if (a._path > b._path)
return 1;
return 0;
}
return b._amount - a._amount;
};

Просмотреть файл

@ -192,8 +192,8 @@ Other Measurements\n\
222.00 MB -- other2\n\
111.00 MB -- other1\n\
100.00 MB -- heap-unused\n\
888 -- other4\n\
777 -- other3\n\
888 -- other4\n\
(???) -- unknown-unit\n\
\n\
2nd Process\n\
@ -263,8 +263,8 @@ Other Measurements\n\
232,783,872 B -- other2\n\
116,391,936 B -- other1\n\
104,857,600 B -- heap-unused\n\
888 -- other4\n\
777 -- other3\n\
888 -- other4\n\
(???) -- unknown-unit\n\
\n\
2nd Process\n\

Просмотреть файл

@ -64,7 +64,7 @@ HISTOGRAM(GLUESTARTUP_READ_TRANSFER, 1, 50 * 1024, 12, EXPONENTIAL, "ProcessIoCo
#elif defined(XP_UNIX)
HISTOGRAM(EARLY_GLUESTARTUP_HARD_FAULTS, 1, 100, 12, LINEAR, "Hard faults count before glue startup")
HISTOGRAM(GLUESTARTUP_HARD_FAULTS, 1, 500, 12, EXPONENTIAL, "Hard faults count after glue startup")
HISTOGRAM(HARD_PAGE_FAULTS, 8, 64 * 1024, 13, EXPONENTIAL, "Hard page faults (since last telemetry ping)")
HISTOGRAM(PAGE_FAULTS_HARD, 8, 64 * 1024, 13, EXPONENTIAL, "Hard page faults (since last telemetry ping)")
#endif
HISTOGRAM(ZIPARCHIVE_CRC, 0, 1, 2, BOOLEAN, "Zip item CRC check pass")
HISTOGRAM(SHUTDOWN_OK, 0, 1, 2, BOOLEAN, "Did the browser start after a successful shutdown")

Просмотреть файл

@ -60,7 +60,7 @@ const MEM_HISTOGRAMS = {
"explicit/images/content/used/uncompressed":
"MEMORY_IMAGES_CONTENT_USED_UNCOMPRESSED",
"heap-used": "MEMORY_HEAP_USED",
"hard-page-faults": "HARD_PAGE_FAULTS"
"page-faults-hard": "PAGE_FAULTS_HARD"
};
XPCOMUtils.defineLazyGetter(this, "Telemetry", function () {

Просмотреть файл

@ -206,8 +206,8 @@ NS_MEMORY_REPORTER_IMPLEMENT(Vsize,
#endif
#if defined(XP_LINUX) || defined(XP_MACOSX)
NS_MEMORY_REPORTER_IMPLEMENT(SoftPageFaults,
"soft-page-faults",
NS_MEMORY_REPORTER_IMPLEMENT(PageFaultsSoft,
"page-faults-soft",
KIND_OTHER,
UNITS_COUNT,
GetSoftPageFaults,
@ -221,8 +221,8 @@ NS_MEMORY_REPORTER_IMPLEMENT(SoftPageFaults,
"and because the OS services a soft page fault without accessing the disk, "
"they impact performance much less than hard page faults.")
NS_MEMORY_REPORTER_IMPLEMENT(HardPageFaults,
"hard-page-faults",
NS_MEMORY_REPORTER_IMPLEMENT(PageFaultsHard,
"page-faults-hard",
KIND_OTHER,
UNITS_COUNT,
GetHardPageFaults,
@ -421,8 +421,8 @@ nsMemoryReporterManager::Init()
#endif
#if defined(XP_LINUX) || defined(XP_MACOSX)
REGISTER(SoftPageFaults);
REGISTER(HardPageFaults);
REGISTER(PageFaultsSoft);
REGISTER(PageFaultsHard);
#endif
#if defined(XP_WIN) && MOZ_WINSDK_TARGETVER >= MOZ_NTDDI_LONGHORN