Bug 666307 - update zip telemetry r=mwu
authorTaras Glek <tglek@mozilla.com>
Wed, 22 Jun 2011 10:24:17 -0700
changeset 71577 a892f5d7cb2e36d782cd3a0b75ead5d0a2a1b357
parent 71576 278449a6964dbf2a184229c32bf77704f2aadab7
child 71578 471e9be56f377f3fbbeca93831d2fd873fb67add
push id20566
push usermlamouri@mozilla.com
push dateThu, 23 Jun 2011 09:20:24 +0000
treeherdermozilla-central@c70b05ca6e88 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmwu
bugs666307
milestone7.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 666307 - update zip telemetry r=mwu
modules/libjar/Makefile.in
modules/libjar/nsZipArchive.cpp
toolkit/components/telemetry/TelemetryHistograms.h
--- a/modules/libjar/Makefile.in
+++ b/modules/libjar/Makefile.in
@@ -66,13 +66,12 @@ LIBXUL_LIBRARY = 1
 
 CPPSRCS		= $(MODULES_LIBJAR_LCPPSRCS)
 
 XPIDLSRCS	= $(MODULES_LIBJAR_LXPIDLSRCS)
 
 EXPORTS		= $(MODULES_LIBJAR_LEXPORTS)
 
 include $(topsrcdir)/config/rules.mk
-include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 ifeq ($(OS_ARCH),WINNT)
 DEFINES		+= -DZLIB_DLL=1
 endif
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -45,35 +45,32 @@
 /*
  * This module implements a simple archive extractor for the PKZIP format.
  *
  * The underlying nsZipArchive is NOT thread-safe. Do not pass references
  * or pointers to it across thread boundaries.
  */
 
 #define READTYPE  PRInt32
-#include "base/basictypes.h"
 #include "zlib.h"
 #include "nsISupportsUtils.h"
 #include "nsRecyclingAllocator.h"
 #include "prio.h"
 #include "plstr.h"
 #include "prlog.h"
 #include "stdlib.h"
 #include "nsWildCard.h"
 #include "nsZipArchive.h"
 #include "nsString.h"
 #include "mozilla/FunctionTimer.h"
 #include "prenv.h"
 #if defined(XP_WIN)
 #include <windows.h>
 #endif
-
-#include "base/histogram.h"
-#include "base/logging.h"
+#include "mozilla/Telemetry.h"
 
 /**
  * Global allocator used with zlib. Destroyed in module shutdown.
  */
 #define NBUCKETS 6
 nsRecyclingAllocator *gZlibAllocator = NULL;
 
 // For placement new used for arena allocations of zip file list
@@ -1076,25 +1073,23 @@ nsZipItemPtr_base::nsZipItemPtr_base(nsZ
     return;
 
   PRUint32 size = 0;
   if (item->Compression() == DEFLATED) {
     size = item->RealSize();
     mAutoBuf = new PRUint8[size];
   }
 
-  const char kCRCHistogram[] = "nsZipItemPtr CRC Match";
-
   nsZipCursor cursor(item, aZip, mAutoBuf, size, doCRC);
   mReturnBuf = cursor.Read(&mReadlen);
   if (!mReturnBuf) {
-    UMA_HISTOGRAM_BOOLEAN(kCRCHistogram, false);
+    Telemetry::Accumulate(Telemetry::ZIPARCHIVE_CRC, false);
     return;
   }
 
   if (mReadlen != item->RealSize()) {
     NS_ASSERTION(mReadlen == item->RealSize(), "nsZipCursor underflow");
     mReturnBuf = nsnull;
     return;
   }
 
-  UMA_HISTOGRAM_BOOLEAN(kCRCHistogram, true);
+  Telemetry::Accumulate(Telemetry::ZIPARCHIVE_CRC, true);
 }
--- a/toolkit/components/telemetry/TelemetryHistograms.h
+++ b/toolkit/components/telemetry/TelemetryHistograms.h
@@ -32,19 +32,19 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 /**
- * This file lists Telemetry histograms collected by Firefox.
- *  Format is HISTOGRAM(id, histogram name, minium, maximum, bucket count,
- * histogram kind, human-readable description for about:telemetry)
+ * This file lists Telemetry histograms collected by Firefox.  Format
+ *  is HISTOGRAM(id, minium, maximum, bucket count, histogram kind,
+ *  human-readable description for about:telemetry)
  */
 
 HISTOGRAM(CYCLE_COLLECTOR, 1, 10000, 50, EXPONENTIAL, "Time(ms) spent on cycle collection")
 HISTOGRAM(TELEMETRY_PING, 1, 3000, 10, EXPONENTIAL, "Time(ms) taken to submit telemetry info")
 HISTOGRAM(TELEMETRY_SUCCESS, 0, 1, 2, BOOLEAN,  "Success(No, Yes) rate of telemetry submissions")
 HISTOGRAM(MEMORY_JS_GC_HEAP, 1024, 512 * 1024, 10, EXPONENTIAL, "Memory(MB) used by the JavaScript GC")
 HISTOGRAM(MEMORY_RESIDENT, 32 * 1024, 1024 * 1024, 10, EXPONENTIAL, "Resident memory(MB) reported by OS")
 HISTOGRAM(MEMORY_LAYOUT_ALL, 1024, 64 * 1024, 10, EXPONENTIAL, "Memory(MB) reported used by layout")
@@ -52,8 +52,9 @@ HISTOGRAM(MEMORY_LAYOUT_ALL, 1024, 64 * 
 HISTOGRAM(EARLY_GLUESTARTUP_READ_OPS, 1, 100, 12, LINEAR, "ProcessIoCounters.ReadOperationCount before glue startup")
 HISTOGRAM(EARLY_GLUESTARTUP_READ_TRANSFER, 1, 50 * 1024, 12, EXPONENTIAL, "ProcessIoCounters.ReadTransferCount before glue startup (KB)")
 HISTOGRAM(GLUESTARTUP_READ_OPS, 1, 100, 12, LINEAR, "ProcessIoCounters.ReadOperationCount after glue startup")
 HISTOGRAM(GLUESTARTUP_READ_TRANSFER, 1, 50 * 1024, 12, EXPONENTIAL, "ProcessIoCounters.ReadTransferCount after glue startup (KB)")
 #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")
 #endif
+HISTOGRAM(ZIPARCHIVE_CRC, 0, 1, 2, BOOLEAN, "Zip item CRC check pass")