Bug 781531 - generate histogram information from JSON; r=taras
authorNathan Froyd <froydnj@mozilla.com>
Fri, 24 Aug 2012 15:54:55 -0400
changeset 105365 b4316e1c474d14ddfa6e9e03575e801cdeae006b
parent 105364 63d6c36e40b8cae2185a5fc90f2a074dcbc3a9ae
child 105366 fb4219f3723d49d9b878187d7b52b36f6a25e9c6
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewerstaras
bugs781531
milestone17.0a1
Bug 781531 - generate histogram information from JSON; r=taras
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/Makefile.in
toolkit/components/telemetry/Telemetry.cpp
toolkit/components/telemetry/Telemetry.h
toolkit/components/telemetry/TelemetryHistograms.h
toolkit/components/telemetry/gen-histogram-data.py
toolkit/components/telemetry/gen-histogram-enum.py
toolkit/components/telemetry/histogram_tools.py
new file mode 100644
--- /dev/null
+++ b/toolkit/components/telemetry/Histograms.json
@@ -0,0 +1,2198 @@
+{
+  "A11Y_INSTANTIATED_FLAG": {
+    "kind": "flag",
+    "description": "has accessibility support been instantiated"
+  },
+  "A11Y_CONSUMERS": {
+    "kind": "enumerated",
+    "n_values": 11,
+    "description": "Accessibility client by enum id"
+  },
+  "A11Y_ISIMPLEDOM_USAGE_FLAG": {
+    "kind": "flag",
+    "description": "have the ISimpleDOM* accessibility interfaces been used"
+  },
+  "A11Y_IATABLE_USAGE_FLAG": {
+    "kind": "flag",
+    "description": "has the IAccessibleTable accessibility interface been used"
+  },
+  "A11Y_XFORMS_USAGE_FLAG": {
+    "kind": "flag",
+    "description": "has XForms accessibility been instantiated"
+  },
+  "A11Y_UPDATE_TIME": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "time spent updating accessibility (ms)"
+  },
+  "CYCLE_COLLECTOR": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent on one cycle collection (ms)"
+  },
+  "CYCLE_COLLECTOR_VISITED_REF_COUNTED": {
+    "kind": "exponential",
+    "high": "300000",
+    "n_buckets": 50,
+    "description": "Number of ref counted objects visited by the cycle collector"
+  },
+  "CYCLE_COLLECTOR_VISITED_GCED": {
+    "kind": "exponential",
+    "high": "300000",
+    "n_buckets": 50,
+    "description": "Number of JS objects visited by the cycle collector"
+  },
+  "CYCLE_COLLECTOR_COLLECTED": {
+    "kind": "exponential",
+    "high": "100000",
+    "n_buckets": 50,
+    "description": "Number of objects collected by the cycle collector"
+  },
+  "CYCLE_COLLECTOR_NEED_GC": {
+    "kind": "boolean",
+    "description": "Needed garbage collection before cycle collection."
+  },
+  "CYCLE_COLLECTOR_TIME_BETWEEN": {
+    "kind": "exponential",
+    "high": "120",
+    "n_buckets": 50,
+    "description": "Time spent in between cycle collections (seconds)"
+  },
+  "CYCLE_COLLECTOR_CONTENT_UNBIND": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent on one ContentUnbinder (ms)"
+  },
+  "FORGET_SKIPPABLE_MAX": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Max time spent on one forget skippable (ms)"
+  },
+  "GC_REASON_2": {
+    "kind": "enumerated",
+    "n_values": "js::gcreason::NUM_TELEMETRY_REASONS",
+    "description": "Reason (enum value) for initiating a GC"
+  },
+  "GC_IS_COMPARTMENTAL": {
+    "kind": "boolean",
+    "description": "Is it a compartmental GC?"
+  },
+  "GC_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent running JS GC (ms)"
+  },
+  "GC_MAX_PAUSE_MS": {
+    "kind": "linear",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "Longest GC slice in a GC (ms)"
+  },
+  "GC_MARK_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent running JS GC mark phase (ms)"
+  },
+  "GC_SWEEP_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent running JS GC sweep phase (ms)"
+  },
+  "GC_MARK_ROOTS_MS": {
+    "kind": "linear",
+    "high": "200",
+    "n_buckets": 50,
+    "description": "Time spent marking GC roots (ms)"
+  },
+  "GC_MARK_GRAY_MS": {
+    "kind": "linear",
+    "high": "200",
+    "n_buckets": 50,
+    "description": "Time spent marking gray GC objects (ms)"
+  },
+  "GC_SLICE_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent running a JS GC slice (ms)"
+  },
+  "GC_MMU_50": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 20,
+    "description": "Minimum percentage of time spent outside GC over any 50ms window"
+  },
+  "GC_RESET": {
+    "kind": "boolean",
+    "description": "Was an incremental GC canceled?"
+  },
+  "GC_INCREMENTAL_DISABLED": {
+    "kind": "boolean",
+    "description": "Is incremental GC permanently disabled?"
+  },
+  "GC_NON_INCREMENTAL": {
+    "kind": "boolean",
+    "description": "Was the GC non-incremental?"
+  },
+  "GC_SCC_SWEEP_TOTAL_MS": {
+    "kind": "linear",
+    "high": "500",
+    "n_buckets": 50,
+    "description": "Time spent sweeping compartment SCCs (ms)"
+  },
+  "GC_SCC_SWEEP_MAX_PAUSE_MS": {
+    "kind": "linear",
+    "high": "500",
+    "n_buckets": 50,
+    "description": "Time spent sweeping slowest compartment SCC (ms)"
+  },
+  "TELEMETRY_PING": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time taken to submit telemetry info (ms)"
+  },
+  "TELEMETRY_SUCCESS": {
+    "kind": "boolean",
+    "description": "Successful telemetry submission"
+  },
+  "MEMORY_JS_COMPARTMENTS_SYSTEM": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "Total JavaScript compartments used for add-ons and internals."
+  },
+  "MEMORY_JS_COMPARTMENTS_USER": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "Total JavaScript compartments used for web pages"
+  },
+  "MEMORY_JS_GC_HEAP": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "512 * 1024",
+    "n_buckets": 50,
+    "description": "Memory used by the garbage-collected JavaScript heap (KB)"
+  },
+  "MEMORY_STORAGE_SQLITE": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "512 * 1024",
+    "n_buckets": 50,
+    "description": "Memory used by SQLite (KB)"
+  },
+  "MEMORY_IMAGES_CONTENT_USED_UNCOMPRESSED": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "1024 * 1024",
+    "n_buckets": 50,
+    "description": "Memory used for uncompressed, in-use content images (KB)"
+  },
+  "MEMORY_HEAP_ALLOCATED": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "1024 * 1024",
+    "n_buckets": 50,
+    "description": "Heap memory allocated (KB)"
+  },
+  "MEMORY_HEAP_COMMITTED_UNUSED": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "512 * 1024",
+    "n_buckets": 50,
+    "description": "Committed, unused heap memory (KB)"
+  },
+  "MEMORY_HEAP_COMMITTED_UNUSED_RATIO": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 25,
+    "description": "Ratio of committed, unused memory to allocated memory in the heap (percentage)."
+  },
+  "MEMORY_EXPLICIT": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "1024 * 1024",
+    "n_buckets": 50,
+    "description": "Explicit memory allocations (KB)"
+  },
+  "GHOST_WINDOWS": {
+    "kind": "exponential",
+    "high": "128",
+    "n_buckets": 8,
+    "description": "Number of ghost windows"
+  },
+  "MEMORY_FREE_PURGED_PAGES_MS": {
+    "kind": "exponential",
+    "high": "1024",
+    "n_buckets": 10,
+    "description": "Time(ms) to purge MADV_FREE'd heap pages.",
+    "cpp_guard": "XP_MACOSX"
+  },
+  "LOW_MEMORY_EVENTS_VIRTUAL": {
+    "kind": "exponential",
+    "high": "1024",
+    "n_buckets": 21,
+    "description": "Number of low-virtual-memory events fired since last ping",
+    "cpp_guard": "XP_WIN"
+  },
+  "LOW_MEMORY_EVENTS_PHYSICAL": {
+    "kind": "exponential",
+    "high": "1024",
+    "n_buckets": 21,
+    "description": "Number of low-physical-memory events fired since last ping",
+    "cpp_guard": "XP_WIN"
+  },
+  "LOW_MEMORY_EVENTS_COMMIT_SPACE": {
+    "kind": "exponential",
+    "high": "1024",
+    "n_buckets": 21,
+    "description": "Number of low-commit-space events fired since last ping",
+    "cpp_guard": "XP_WIN"
+  },
+  "EARLY_GLUESTARTUP_READ_OPS": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 12,
+    "description": "ProcessIoCounters.ReadOperationCount before glue startup",
+    "cpp_guard": "XP_WIN"
+  },
+  "EARLY_GLUESTARTUP_READ_TRANSFER": {
+    "kind": "exponential",
+    "high": "50 * 1024",
+    "n_buckets": 12,
+    "description": "ProcessIoCounters.ReadTransferCount before glue startup (KB)",
+    "cpp_guard": "XP_WIN"
+  },
+  "GLUESTARTUP_READ_OPS": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 12,
+    "description": "ProcessIoCounters.ReadOperationCount after glue startup",
+    "cpp_guard": "XP_WIN"
+  },
+  "GLUESTARTUP_READ_TRANSFER": {
+    "kind": "exponential",
+    "high": "50 * 1024",
+    "n_buckets": 12,
+    "description": "ProcessIoCounters.ReadTransferCount after glue startup (KB)",
+    "cpp_guard": "XP_WIN"
+  },
+  "EARLY_GLUESTARTUP_HARD_FAULTS": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 12,
+    "description": "Hard faults count before glue startup",
+    "cpp_guard": "XP_UNIX"
+  },
+  "GLUESTARTUP_HARD_FAULTS": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 12,
+    "description": "Hard faults count after glue startup",
+    "cpp_guard": "XP_UNIX"
+  },
+  "PAGE_FAULTS_HARD": {
+    "kind": "exponential",
+    "low": 8,
+    "high": "64 * 1024",
+    "n_buckets": 13,
+    "description": "Hard page faults (since last telemetry ping)",
+    "cpp_guard": "XP_UNIX"
+  },
+  "FONTLIST_INITOTHERFAMILYNAMES": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "Time(ms) spent on reading other family names from all fonts"
+  },
+  "FONTLIST_INITFACENAMELISTS": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "Time(ms) spent on reading family names from all fonts"
+  },
+  "DWRITEFONT_INITFONTLIST_TOTAL": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::InitFontList Total (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_INITFONTLIST_INIT": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::InitFontList init (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_INITFONTLIST_GDI": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::InitFontList GdiInterop object (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_DELAYEDINITFONTLIST_TOTAL": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::DelayedInitFontList Total (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_DELAYEDINITFONTLIST_COUNT": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::DelayedInitFontList Font Family Count",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_DELAYEDINITFONTLIST_GDI_TABLE": {
+    "kind": "boolean",
+    "description": "gfxDWriteFontList::DelayedInitFontList GDI Table Access",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_DELAYEDINITFONTLIST_COLLECT": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::DelayedInitFontList GetSystemFontCollection (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "DWRITEFONT_DELAYEDINITFONTLIST_ITERATE": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxDWriteFontList::DelayedInitFontList iterate over families (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "GDI_INITFONTLIST_TOTAL": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxGDIFontList::InitFontList Total (ms)",
+    "cpp_guard": "XP_WIN"
+  },
+  "MAC_INITFONTLIST_TOTAL": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "gfxMacPlatformFontList::InitFontList Total (ms)",
+    "cpp_guard": "XP_MACOSX"
+  },
+  "SYSTEM_FONT_FALLBACK": {
+    "kind": "exponential",
+    "high": "100000",
+    "n_buckets": 50,
+    "description": "System font fallback (us)"
+  },
+  "SYSTEM_FONT_FALLBACK_FIRST": {
+    "kind": "exponential",
+    "high": "40000",
+    "n_buckets": 20,
+    "description": "System font fallback, first call (ms)"
+  },
+  "SYSTEM_FONT_FALLBACK_SCRIPT": {
+    "kind": "linear",
+    "high": "110",
+    "n_buckets": 111,
+    "description": "System font fallback script"
+  },
+  "STARTUP_CACHE_AGE_HOURS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 20,
+    "description": "Startup cache age (hours)"
+  },
+  "WORD_CACHE_HITS": {
+    "kind": "exponential",
+    "high": "256",
+    "n_buckets": 30,
+    "description": "Word cache hits (chars)"
+  },
+  "WORD_CACHE_MISSES": {
+    "kind": "exponential",
+    "high": "256",
+    "n_buckets": 30,
+    "description": "Word cache misses (chars)"
+  },
+  "FONT_CACHE_HIT": {
+    "kind": "boolean",
+    "description": "font cache hit"
+  },
+  "BAD_FALLBACK_FONT": {
+    "kind": "boolean",
+    "description": "system fallback font can't be used"
+  },
+  "SHUTDOWN_OK": {
+    "kind": "boolean",
+    "description": "Did the browser start after a successful shutdown"
+  },
+  "IMAGE_DECODE_LATENCY": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "5000000",
+    "n_buckets": 100,
+    "description": "Time spent decoding an image chunk (us)"
+  },
+  "IMAGE_DECODE_TIME": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "50000000",
+    "n_buckets": 100,
+    "description": "Time spent decoding an image (us)"
+  },
+  "IMAGE_DECODE_ON_DRAW_LATENCY": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "50000000",
+    "n_buckets": 100,
+    "description": "Time from starting a decode to it showing up on the screen (us)"
+  },
+  "IMAGE_DECODE_CHUNKS": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 50,
+    "description": "Number of chunks per decode attempt"
+  },
+  "IMAGE_DECODE_COUNT": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 50,
+    "description": "Decode count"
+  },
+  "IMAGE_DECODE_SPEED_JPEG": {
+    "kind": "exponential",
+    "low": 500,
+    "high": "50000000",
+    "n_buckets": 50,
+    "description": "JPEG image decode speed (Kbytes/sec)"
+  },
+  "IMAGE_DECODE_SPEED_GIF": {
+    "kind": "exponential",
+    "low": 500,
+    "high": "50000000",
+    "n_buckets": 50,
+    "description": "GIF image decode speed (Kbytes/sec)"
+  },
+  "IMAGE_DECODE_SPEED_PNG": {
+    "kind": "exponential",
+    "low": 500,
+    "high": "50000000",
+    "n_buckets": 50,
+    "description": "PNG image decode speed (Kbytes/sec)"
+  },
+  "CANVAS_2D_USED": {
+    "kind": "boolean",
+    "description": "2D canvas used"
+  },
+  "CANVAS_WEBGL_USED": {
+    "kind": "boolean",
+    "description": "WebGL canvas used"
+  },
+  "TOTAL_CONTENT_PAGE_LOAD_TIME": {
+    "kind": "exponential",
+    "low": 100,
+    "high": "30000",
+    "n_buckets": 100,
+    "description": "HTTP: Total page load time (ms)"
+  },
+  "HTTP_SUBITEM_OPEN_LATENCY_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Page start -> subitem open() (ms)"
+  },
+  "HTTP_SUBITEM_FIRST_BYTE_LATENCY_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Page start -> first byte received for subitem reply (ms)"
+  },
+  "HTTP_REQUEST_PER_PAGE": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "HTTP: Requests per page (count)"
+  },
+  "HTTP_REQUEST_PER_PAGE_FROM_CACHE": {
+    "kind": "linear",
+    "high": "101",
+    "n_buckets": 102,
+    "description": "HTTP: Requests serviced from cache (%)"
+  },
+  "HTTP_REQUEST_PER_CONN": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "HTTP: requests per connection"
+  },
+  "HTTP_KBREAD_PER_CONN": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 50,
+    "description": "HTTP: KB read per connection"
+  },
+  "HTTP_PAGE_DNS_ISSUE_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: open() -> DNS request issued (ms)"
+  },
+  "HTTP_PAGE_DNS_LOOKUP_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: DNS lookup time (ms)"
+  },
+  "HTTP_PAGE_TCP_CONNECTION": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: TCP connection setup (ms)"
+  },
+  "HTTP_PAGE_OPEN_TO_FIRST_SENT": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Open -> first byte of request sent (ms)"
+  },
+  "HTTP_PAGE_FIRST_SENT_TO_LAST_RECEIVED": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: First byte of request sent -> last byte of response received (ms)"
+  },
+  "HTTP_PAGE_OPEN_TO_FIRST_RECEIVED": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Open -> first byte of reply received (ms)"
+  },
+  "HTTP_PAGE_OPEN_TO_FIRST_FROM_CACHE": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Open -> cache read start (ms)"
+  },
+  "HTTP_PAGE_CACHE_READ_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Cache read time (ms)"
+  },
+  "HTTP_PAGE_REVALIDATION": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Positive cache validation time (ms)"
+  },
+  "HTTP_PAGE_COMPLETE_LOAD": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Overall load time - all (ms)"
+  },
+  "HTTP_PAGE_COMPLETE_LOAD_CACHED": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Overall load time - cache hits (ms)"
+  },
+  "HTTP_PAGE_COMPLETE_LOAD_NET": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP page: Overall load time - network (ms)"
+  },
+  "HTTP_SUB_DNS_ISSUE_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: open() -> DNS request issued (ms)"
+  },
+  "HTTP_SUB_DNS_LOOKUP_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: DNS lookup time (ms)"
+  },
+  "HTTP_SUB_TCP_CONNECTION": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: TCP connection setup (ms)"
+  },
+  "HTTP_SUB_OPEN_TO_FIRST_SENT": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Open -> first byte of request sent (ms)"
+  },
+  "HTTP_SUB_FIRST_SENT_TO_LAST_RECEIVED": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: First byte of request sent -> last byte of response received (ms)"
+  },
+  "HTTP_SUB_OPEN_TO_FIRST_RECEIVED": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Open -> first byte of reply received (ms)"
+  },
+  "HTTP_SUB_OPEN_TO_FIRST_FROM_CACHE": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Open -> cache read start (ms)"
+  },
+  "HTTP_SUB_CACHE_READ_TIME": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Cache read time (ms)"
+  },
+  "HTTP_SUB_REVALIDATION": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Positive cache validation time (ms)"
+  },
+  "HTTP_SUB_COMPLETE_LOAD": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Overall load time - all (ms)"
+  },
+  "HTTP_SUB_COMPLETE_LOAD_CACHED": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Overall load time - cache hits (ms)"
+  },
+  "HTTP_SUB_COMPLETE_LOAD_NET": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 50,
+    "description": "HTTP subitem: Overall load time - network (ms)"
+  },
+  "SPDY_VERSION2": {
+    "kind": "enumerated",
+    "n_values": 48,
+    "description": "SPDY: Protocol Version Used"
+  },
+  "SPDY_PARALLEL_STREAMS": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "SPDY: Streams concurrent active per connection"
+  },
+  "SPDY_REQUEST_PER_CONN": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "SPDY: Streams created per connection"
+  },
+  "SPDY_SERVER_INITIATED_STREAMS": {
+    "kind": "exponential",
+    "high": "100000",
+    "n_buckets": 250,
+    "description": "SPDY: Streams recevied per connection"
+  },
+  "SPDY_CHUNK_RECVD": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 100,
+    "description": "SPDY: Recvd Chunk Size (rounded to KB)"
+  },
+  "SPDY_SYN_SIZE": {
+    "kind": "exponential",
+    "low": 20,
+    "high": "20000",
+    "n_buckets": 50,
+    "description": "SPDY: SYN Frame Header Size"
+  },
+  "SPDY_SYN_RATIO": {
+    "kind": "linear",
+    "high": "99",
+    "n_buckets": 20,
+    "description": "SPDY: SYN Frame Header Ratio (lower better)"
+  },
+  "SPDY_SYN_REPLY_SIZE": {
+    "kind": "exponential",
+    "low": 16,
+    "high": "20000",
+    "n_buckets": 50,
+    "description": "SPDY: SYN Reply Header Size"
+  },
+  "SPDY_SYN_REPLY_RATIO": {
+    "kind": "linear",
+    "high": "99",
+    "n_buckets": 20,
+    "description": "SPDY: SYN Reply Header Ratio (lower better)"
+  },
+  "SPDY_NPN_CONNECT": {
+    "kind": "boolean",
+    "description": "SPDY: NPN Negotiated"
+  },
+  "SPDY_NPN_JOIN": {
+    "kind": "boolean",
+    "description": "SPDY: Coalesce Succeeded"
+  },
+  "SPDY_KBREAD_PER_CONN": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 50,
+    "description": "SPDY: KB read per connection"
+  },
+  "SPDY_PING_EXPERIMENT_PASS": {
+    "kind": "linear",
+    "low": 10,
+    "high": "355",
+    "n_buckets": 64,
+    "description": "SPDY: Ping Interval Passed"
+  },
+  "SPDY_PING_EXPERIMENT_FAIL": {
+    "kind": "linear",
+    "low": 10,
+    "high": "355",
+    "n_buckets": 64,
+    "description": "SPDY: Ping Interval Failed"
+  },
+  "SPDY_SETTINGS_UL_BW": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 100,
+    "description": "SPDY: Settings Upload Bandwidth"
+  },
+  "SPDY_SETTINGS_DL_BW": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 100,
+    "description": "SPDY: Settings Download Bandwidth"
+  },
+  "SPDY_SETTINGS_RTT": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 100,
+    "description": "SPDY: Settings RTT"
+  },
+  "SPDY_SETTINGS_MAX_STREAMS": {
+    "kind": "exponential",
+    "high": "5000",
+    "n_buckets": 100,
+    "description": "SPDY: Settings Max Streams parameter"
+  },
+  "SPDY_SETTINGS_CWND": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 50,
+    "description": "SPDY: Settings CWND (packets)"
+  },
+  "SPDY_SETTINGS_RETRANS": {
+    "kind": "exponential",
+    "high": "100",
+    "n_buckets": 50,
+    "description": "SPDY: Retransmission Rate"
+  },
+  "SPDY_SETTINGS_IW": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 50,
+    "description": "SPDY: Settings IW (rounded to KB)"
+  },
+  "DISK_CACHE_CORRUPT_DETAILS": {
+    "kind": "enumerated",
+    "n_values": 50,
+    "description": "Why the HTTP disk cache was corrupted at startup"
+  },
+  "DISK_CACHE_REDUCTION_TRIAL": {
+    "kind": "boolean",
+    "description": "Stores 1 if the cache would be clean with the disk cache corruption plan of Bug 105843"
+  },
+  "HTTP_CACHE_DISPOSITION_2": {
+    "kind": "enumerated",
+    "n_values": 5,
+    "description": "HTTP Cache Hit, Reval, Failed-Reval, Miss"
+  },
+  "HTTP_DISK_CACHE_DISPOSITION_2": {
+    "kind": "enumerated",
+    "n_values": 5,
+    "description": "HTTP Disk Cache Hit, Reval, Failed-Reval, Miss"
+  },
+  "HTTP_MEMORY_CACHE_DISPOSITION_2": {
+    "kind": "enumerated",
+    "n_values": 5,
+    "description": "HTTP Memory Cache Hit, Reval, Failed-Reval, Miss"
+  },
+  "HTTP_OFFLINE_CACHE_DISPOSITION_2": {
+    "kind": "enumerated",
+    "n_values": 5,
+    "description": "HTTP Offline Cache Hit, Reval, Failed-Reval, Miss"
+  },
+  "CACHE_DEVICE_SEARCH_2": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time to search cache (ms)"
+  },
+  "CACHE_MEMORY_SEARCH_2": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time to search memory cache (ms)"
+  },
+  "CACHE_DISK_SEARCH_2": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time to search disk cache (ms)"
+  },
+  "CACHE_OFFLINE_SEARCH_2": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time to search offline cache (ms)"
+  },
+  "HTTP_DISK_CACHE_OVERHEAD": {
+    "kind": "exponential",
+    "high": "32000000",
+    "n_buckets": 100,
+    "description": "HTTP Disk cache memory overhead (bytes)"
+  },
+  "CACHE_LM_INCONSISTENT": {
+    "kind": "boolean",
+    "description": "Cache discovered inconsistent last-modified entry"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_2": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms)"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_2": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock on the main thread (ms)"
+  },
+  "DISK_CACHE_SMART_SIZE_USING_OLD_MAX": {
+    "kind": "boolean",
+    "description": "Whether we are using the old default cache smart size"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSSETDISKSMARTSIZECALLBACK_NOTIFY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSSETDISKSMARTSIZECALLBACK_NOTIFY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSPROCESSREQUESTEVENT_RUN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSPROCESSREQUESTEVENT_RUN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSOUTPUTSTREAMWRAPPER_LAZYINIT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSOUTPUTSTREAMWRAPPER_LAZYINIT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSOUTPUTSTREAMWRAPPER_CLOSE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSOUTPUTSTREAMWRAPPER_CLOSE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSINPUTSTREAMWRAPPER_LAZYINIT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSINPUTSTREAMWRAPPER_LAZYINIT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSEVICTDISKCACHEENTRIESEVENT_RUN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSEVICTDISKCACHEENTRIESEVENT_RUN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSDOOMEVENT_RUN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSDOOMEVENT_RUN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSDISKCACHESTREAMIO_WRITE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSDISKCACHESTREAMIO_WRITE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSDISKCACHESTREAMIO_CLOSEOUTPUTSTREAM": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSDISKCACHESTREAMIO_CLOSEOUTPUTSTREAM"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSDISKCACHEDEVICEDEACTIVATEENTRYEVENT_RUN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSDISKCACHEDEVICEDEACTIVATEENTRYEVENT_RUN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSDISKCACHEBINDING_DESTRUCTOR": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSDISKCACHEBINDING_DESTRUCTOR"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SHUTDOWN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SHUTDOWN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETOFFLINECACHEENABLED": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETOFFLINECACHEENABLED"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETOFFLINECACHECAPACITY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETOFFLINECACHECAPACITY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETMEMORYCACHE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETMEMORYCACHE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETDISKSMARTSIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETDISKSMARTSIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETDISKCACHEMAXENTRYSIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETDISKCACHEMAXENTRYSIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETMEMORYCACHEMAXENTRYSIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETMEMORYCACHEMAXENTRYSIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETDISKCACHEENABLED": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETDISKCACHEENABLED"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_SETDISKCACHECAPACITY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_SETDISKCACHECAPACITY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_OPENCACHEENTRY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_OPENCACHEENTRY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_ONPROFILESHUTDOWN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_ONPROFILESHUTDOWN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_ONPROFILECHANGED": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_ONPROFILECHANGED"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_LEAVEPRIVATEBROWSING": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_LEAVEPRIVATEBROWSING"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_ISSTORAGEENABLEDFORPOLICY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_ISSTORAGEENABLEDFORPOLICY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_GETCACHEIOTARGET": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_GETCACHEIOTARGET"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_EVICTENTRIESFORCLIENT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_EVICTENTRIESFORCLIENT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_DOOM": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_DOOM"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETPREDICTEDDATASIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETPREDICTEDDATASIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETDATASIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETDATASIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETSTORAGEDATASIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETSTORAGEDATASIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_REQUESTDATASIZECHANGE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_REQUESTDATASIZECHANGE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETDATASIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETDATASIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_OPENINPUTSTREAM": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_OPENINPUTSTREAM"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_OPENOUTPUTSTREAM": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_OPENOUTPUTSTREAM"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETCACHEELEMENT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETCACHEELEMENT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETCACHEELEMENT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETCACHEELEMENT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETSTORAGEPOLICY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETSTORAGEPOLICY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETSTORAGEPOLICY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETSTORAGEPOLICY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETFILE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETFILE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETSECURITYINFO": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETSECURITYINFO"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETSECURITYINFO": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETSECURITYINFO"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_DOOMANDFAILPENDINGREQUESTS": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_DOOMANDFAILPENDINGREQUESTS"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_MARKVALID": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_MARKVALID"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_CLOSE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_CLOSE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETMETADATAELEMENT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETMETADATAELEMENT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETMETADATAELEMENT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETMETADATAELEMENT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_VISITMETADATA": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_VISITMETADATA"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_SETEXPIRATIONTIME": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_SETEXPIRATIONTIME"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_ISSTREAMBASED": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_ISSTREAMBASED"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETLASTMODIFIED": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETLASTMODIFIED"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETEXPIRATIONTIME": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETEXPIRATIONTIME"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETKEY": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETKEY"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETFETCHCOUNT": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETFETCHCOUNT"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETDEVICEID": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETDEVICEID"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_PROCESSREQUEST": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_PROCESSREQUEST"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHESERVICE_VISITENTRIES": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHESERVICE_VISITENTRIES"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETPREDICTEDDATASIZE": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETPREDICTEDDATASIZE"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETLASTFETCHED": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETLASTFETCHED"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSCACHEENTRYDESCRIPTOR_GETCLIENTID": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSCACHEENTRYDESCRIPTOR_GETCLIENTID"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSBLOCKONCACHETHREADEVENT_RUN": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSBLOCKONCACHETHREADEVENT_RUN"
+  },
+  "CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_NSDISKCACHEMAP_REVALIDATION": {
+    "kind": "exponential",
+    "high": "10 * 1000",
+    "n_buckets": 50,
+    "description": "Time spent waiting on the cache service lock (ms) on the main thread in NSDISKCACHEMAP_REVALIDATION"
+  },
+  "DNS_LOOKUP_METHOD2": {
+    "kind": "enumerated",
+    "n_values": 16,
+    "description": "DNS Lookup Type (hit, renewal, negative-hit, literal, overflow, network-first, network-shared)"
+  },
+  "DNS_CLEANUP_AGE": {
+    "kind": "exponential",
+    "high": "1440",
+    "n_buckets": 50,
+    "description": "DNS Cache Entry Age at Removal Time (minutes)"
+  },
+  "DNS_LOOKUP_TIME": {
+    "kind": "exponential",
+    "high": "60000",
+    "n_buckets": 50,
+    "description": "Time for a successful DNS OS resolution (msec)"
+  },
+  "DNS_RENEWAL_TIME": {
+    "kind": "exponential",
+    "high": "60000",
+    "n_buckets": 50,
+    "description": "Time for a renewed DNS OS resolution (msec)"
+  },
+  "DNS_FAILED_LOOKUP_TIME": {
+    "kind": "exponential",
+    "high": "60000",
+    "n_buckets": 50,
+    "description": "Time for an unsuccessful DNS OS resolution (msec)"
+  },
+  "FIND_PLUGINS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent scanning filesystem for plugins (ms)"
+  },
+  "CHECK_JAVA_ENABLED": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent checking if Java is enabled (ms)"
+  },
+  "PLUGIN_SHUTDOWN_MS": {
+    "kind": "exponential",
+    "high": "5000",
+    "n_buckets": 20,
+    "description": "Time spent shutting down plugins (ms)"
+  },
+  "MOZ_SQLITE_OPEN_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite open() (ms)"
+  },
+  "MOZ_SQLITE_OPEN_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite open() (ms)"
+  },
+  "MOZ_SQLITE_TRUNCATE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite truncate() (ms)"
+  },
+  "MOZ_SQLITE_TRUNCATE_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite truncate() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_READ_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_READ_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_PLACES_READ_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_PLACES_READ_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_COOKIES_READ_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_COOKIES_READ_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_WEBAPPS_READ_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_WEBAPPS_READ_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite read() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_WRITE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_WRITE_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_PLACES_WRITE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_PLACES_WRITE_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_COOKIES_WRITE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_COOKIES_WRITE_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_WEBAPPS_WRITE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_WEBAPPS_WRITE_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite write() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_SYNC_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_SYNC_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_PLACES_SYNC_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_PLACES_SYNC_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_COOKIES_SYNC_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_COOKIES_SYNC_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_WEBAPPS_SYNC_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_WEBAPPS_SYNC_MAIN_THREAD_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on SQLite fsync() (ms)"
+  },
+  "MOZ_SQLITE_OTHER_READ_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite read() (bytes)"
+  },
+  "MOZ_SQLITE_PLACES_READ_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite read() (bytes)"
+  },
+  "MOZ_SQLITE_COOKIES_READ_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite read() (bytes)"
+  },
+  "MOZ_SQLITE_WEBAPPS_READ_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite read() (bytes)"
+  },
+  "MOZ_SQLITE_PLACES_WRITE_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite write (bytes)"
+  },
+  "MOZ_SQLITE_COOKIES_WRITE_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite write (bytes)"
+  },
+  "MOZ_SQLITE_WEBAPPS_WRITE_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite write (bytes)"
+  },
+  "MOZ_SQLITE_OTHER_WRITE_B": {
+    "kind": "linear",
+    "high": "32768",
+    "n_buckets": 3,
+    "description": "SQLite write (bytes)"
+  },
+  "MOZ_STORAGE_ASYNC_REQUESTS_MS": {
+    "kind": "exponential",
+    "high": "32768",
+    "n_buckets": 20,
+    "description": "mozStorage async requests completion (ms)"
+  },
+  "MOZ_STORAGE_ASYNC_REQUESTS_SUCCESS": {
+    "kind": "boolean",
+    "description": "mozStorage async requests success"
+  },
+  "STARTUP_MEASUREMENT_ERRORS": {
+    "kind": "enumerated",
+    "n_values": "mozilla::StartupTimeline::MAX_EVENT_ID",
+    "description": "Flags errors in startup calculation()"
+  },
+  "NETWORK_DISK_CACHE_OPEN": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent opening disk cache (ms)"
+  },
+  "NETWORK_DISK_CACHE_TRASHRENAME": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent renaming bad Cache to Cache.Trash (ms)"
+  },
+  "NETWORK_DISK_CACHE_DELETEDIR": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent deleting disk cache (ms)"
+  },
+  "NETWORK_DISK_CACHE_DELETEDIR_SHUTDOWN": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent during showdown stopping thread deleting old disk cache (ms)"
+  },
+  "NETWORK_DISK_CACHE_SHUTDOWN": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Total Time spent (ms) during disk cache showdown"
+  },
+  "NETWORK_DISK_CACHE_SHUTDOWN_CLEAR_PRIVATE": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent (ms) during showdown deleting disk cache for 'clear private data' option"
+  },
+  "NETWORK_DISK_CACHE_REVALIDATION": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Total Time spent (ms) during disk cache revalidation"
+  },
+  "NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent in nsDiskCacheOutputStream::Close() on non-main thread (ms)"
+  },
+  "NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE_MAIN_THREAD": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent in nsDiskCacheOutputStream::Close() on the main thread (ms)"
+  },
+  "NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE_INTERNAL": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent in nsDiskCacheOutputStream::CloseInternal() on non-main thread (ms)"
+  },
+  "NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE_INTERNAL_MAIN_THREAD": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "Time spent in nsDiskCacheOutputStream::CloseInternal on the main thread (ms)"
+  },
+  "IDLE_NOTIFY_BACK_MS": {
+    "kind": "exponential",
+    "high": "5000",
+    "n_buckets": 10,
+    "description": "Time spent checking for and notifying listeners that the user is back (ms)"
+  },
+  "IDLE_NOTIFY_BACK_LISTENERS": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 20,
+    "description": "Number of listeners notified that the user is back"
+  },
+  "IDLE_NOTIFY_IDLE_MS": {
+    "kind": "exponential",
+    "high": "5000",
+    "n_buckets": 10,
+    "description": "Time spent checking for and notifying listeners that the user is idle (ms)"
+  },
+  "IDLE_NOTIFY_IDLE_LISTENERS": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 20,
+    "description": "Number of listeners notified that the user is idle"
+  },
+  "URLCLASSIFIER_LOOKUP_TIME": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 10,
+    "description": "Time spent per dbservice lookup (ms)"
+  },
+  "URLCLASSIFIER_CL_CHECK_TIME": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 10,
+    "description": "Time spent per classifier lookup (ms)"
+  },
+  "URLCLASSIFIER_CL_UPDATE_TIME": {
+    "kind": "exponential",
+    "low": 20,
+    "high": "15000",
+    "n_buckets": 15,
+    "description": "Time spent per classifier update (ms)"
+  },
+  "URLCLASSIFIER_PS_FILELOAD_TIME": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 10,
+    "description": "Time spent loading PrefixSet from file (ms)"
+  },
+  "URLCLASSIFIER_PS_FALLOCATE_TIME": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 10,
+    "description": "Time spent fallocating PrefixSet (ms)"
+  },
+  "URLCLASSIFIER_PS_CONSTRUCT_TIME": {
+    "kind": "exponential",
+    "high": "5000",
+    "n_buckets": 15,
+    "description": "Time spent constructing PrefixSet from DB (ms)"
+  },
+  "URLCLASSIFIER_LC_PREFIXES": {
+    "kind": "linear",
+    "high": "1500000",
+    "n_buckets": 15,
+    "description": "Size of the prefix cache in entries"
+  },
+  "URLCLASSIFIER_LC_COMPLETIONS": {
+    "kind": "exponential",
+    "high": "200",
+    "n_buckets": 10,
+    "description": "Size of the completion cache in entries"
+  },
+  "URLCLASSIFIER_PS_FAILURE": {
+    "kind": "boolean",
+    "description": "Did UrlClassifier fail to construct the PrefixSet?"
+  },
+  "PLACES_PAGES_COUNT": {
+    "kind": "exponential",
+    "low": 1000,
+    "high": "150000",
+    "n_buckets": 20,
+    "description": "PLACES: Number of unique pages"
+  },
+  "PLACES_BOOKMARKS_COUNT": {
+    "kind": "exponential",
+    "low": 100,
+    "high": "8000",
+    "n_buckets": 15,
+    "description": "PLACES: Number of bookmarks"
+  },
+  "PLACES_TAGS_COUNT": {
+    "kind": "exponential",
+    "high": "200",
+    "n_buckets": 10,
+    "description": "PLACES: Number of tags"
+  },
+  "PLACES_FOLDERS_COUNT": {
+    "kind": "exponential",
+    "high": "200",
+    "n_buckets": 10,
+    "description": "PLACES: Number of folders"
+  },
+  "PLACES_KEYWORDS_COUNT": {
+    "kind": "exponential",
+    "high": "200",
+    "n_buckets": 10,
+    "description": "PLACES: Number of keywords"
+  },
+  "PLACES_SORTED_BOOKMARKS_PERC": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 10,
+    "description": "PLACES: Percentage of bookmarks organized in folders"
+  },
+  "PLACES_TAGGED_BOOKMARKS_PERC": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 10,
+    "description": "PLACES: Percentage of tagged bookmarks"
+  },
+  "PLACES_DATABASE_FILESIZE_MB": {
+    "kind": "exponential",
+    "low": 5,
+    "high": "200",
+    "n_buckets": 10,
+    "description": "PLACES: Database filesize (MB)"
+  },
+  "PLACES_DATABASE_JOURNALSIZE_MB": {
+    "kind": "exponential",
+    "high": "50",
+    "n_buckets": 10,
+    "description": "PLACES: Database journal size (MB)"
+  },
+  "PLACES_DATABASE_PAGESIZE_B": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "PLACES: Database page size (bytes)"
+  },
+  "PLACES_DATABASE_SIZE_PER_PAGE_B": {
+    "kind": "exponential",
+    "low": 500,
+    "high": "10240",
+    "n_buckets": 20,
+    "description": "PLACES: Average size of a place in the database (bytes)"
+  },
+  "PLACES_EXPIRATION_STEPS_TO_CLEAN2": {
+    "kind": "enumerated",
+    "n_values": 10,
+    "description": "PLACES: Expiration steps to cleanup the database"
+  },
+  "PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "500",
+    "n_buckets": 10,
+    "description": "PLACES: Time for first autocomplete result if > 50ms (ms)"
+  },
+  "PLACES_IDLE_FRECENCY_DECAY_TIME_MS": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "PLACES: Time to decay all frecencies values on idle (ms)"
+  },
+  "PLACES_IDLE_MAINTENANCE_TIME_MS": {
+    "kind": "exponential",
+    "low": 1000,
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "PLACES: Time to execute maintenance tasks on idle (ms)"
+  },
+  "PLACES_ANNOS_BOOKMARKS_COUNT": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "5000",
+    "n_buckets": 10,
+    "description": "PLACES: Number of bookmarks annotations"
+  },
+  "PLACES_ANNOS_BOOKMARKS_SIZE_KB": {
+    "kind": "exponential",
+    "low": 10,
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "PLACES: Size of bookmarks annotations (KB)"
+  },
+  "PLACES_ANNOS_PAGES_COUNT": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "5000",
+    "n_buckets": 10,
+    "description": "PLACES: Number of pages annotations"
+  },
+  "PLACES_ANNOS_PAGES_SIZE_KB": {
+    "kind": "exponential",
+    "low": 10,
+    "high": "10000",
+    "n_buckets": 10,
+    "description": "PLACES: Size of pages annotations (KB)"
+  },
+  "PLACES_FRECENCY_CALC_TIME_MS": {
+    "kind": "exponential",
+    "high": "100",
+    "n_buckets": 10,
+    "description": "PLACES: Time to calculate frecency of a page (ms)"
+  },
+  "UPDATER_STATUS_CODES": {
+    "kind": "linear",
+    "high": "50",
+    "n_buckets": 51,
+    "description": "Updater: the status of the latest update performed"
+  },
+  "UPDATER_UPDATES_ENABLED": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not updates are enabled"
+  },
+  "UPDATER_UPDATES_AUTOMATIC": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not updates are automatic"
+  },
+  "UPDATER_SERVICE_ENABLED": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not the MozillaMaintenance service is enabled"
+  },
+  "UPDATER_SERVICE_ERRORS": {
+    "kind": "linear",
+    "high": "30",
+    "n_buckets": 31,
+    "description": "Updater: The number of MozillaMaintenance service errors that have occurred"
+  },
+  "UPDATER_SERVICE_INSTALLED": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not the MozillaMaintenance service is installed"
+  },
+  "UPDATER_SERVICE_MANUALLY_UNINSTALLED": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not someone manually uninstalled the service."
+  },
+  "UPDATER_STAGE_ENABLED": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not staging updates are enabled"
+  },
+  "UPDATER_HAS_PERMISSIONS": {
+    "kind": "boolean",
+    "description": "Updater: Whether or not the updater has permissions"
+  },
+  "THUNDERBIRD_GLODA_SIZE_MB": {
+    "kind": "linear",
+    "high": "1000",
+    "n_buckets": 40,
+    "description": "Gloda: size of global-messages-db.sqlite (MB)"
+  },
+  "THUNDERBIRD_CONVERSATIONS_TIME_TO_2ND_GLODA_QUERY_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 30,
+    "description": "Conversations: time between the moment we click and the second gloda query returns (ms)"
+  },
+  "THUNDERBIRD_INDEXING_RATE_MSG_PER_S": {
+    "kind": "linear",
+    "high": "100",
+    "n_buckets": 20,
+    "description": "Gloda: indexing rate (message/s)"
+  },
+  "FX_TAB_ANIM_OPEN_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Firefox: Time taken by the tab opening animation in milliseconds"
+  },
+  "FX_TAB_ANIM_CLOSE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Firefox: Time taken by the tab closing animation in milliseconds"
+  },
+  "FX_KEYWORD_URL_USERSET": {
+    "kind": "boolean",
+    "description": "Firefox: keyword.URL has a user-set value"
+  },
+  "FX_IDENTITY_POPUP_OPEN_MS": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 10,
+    "description": "Firefox: Time taken by the identity popup to open in milliseconds"
+  },
+  "FX_APP_MENU_OPEN_MS": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 10,
+    "description": "Firefox: Time taken by the app-menu opening in milliseconds"
+  },
+  "FX_BOOKMARKS_TOOLBAR_INIT_MS": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "5000",
+    "n_buckets": 10,
+    "description": "Firefox: Time to initialize the bookmarks toolbar view (ms)"
+  },
+  "FX_NEW_WINDOW_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 20,
+    "description": "Firefox: Time taken to open a new browser window (ms)"
+  },
+  "FX_THUMBNAILS_CAPTURE_TIME_MS": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 15,
+    "description": "THUMBNAILS: Time (ms) it takes to capture a thumbnail"
+  },
+  "FX_THUMBNAILS_STORE_TIME_MS": {
+    "kind": "exponential",
+    "high": "500",
+    "n_buckets": 15,
+    "description": "THUMBNAILS: Time (ms) it takes to store a thumbnail in the cache"
+  },
+  "FX_THUMBNAILS_HIT_OR_MISS": {
+    "kind": "boolean",
+    "description": "THUMBNAILS: Thumbnail found"
+  },
+  "EVENTLOOP_UI_LAG_EXP_MS": {
+    "kind": "exponential",
+    "low": 50,
+    "high": "60000",
+    "n_buckets": 20,
+    "description": "Widget: Time it takes for the message before a UI message (ms)"
+  },
+  "FX_SESSION_RESTORE_COLLECT_DATA_MS": {
+    "kind": "exponential",
+    "high": "30000",
+    "n_buckets": 10,
+    "description": "Session restore: Time to collect all window and tab data (ms)"
+  },
+  "FX_SESSION_RESTORE_SERIALIZE_DATA_MS": {
+    "kind": "exponential",
+    "high": "1000",
+    "n_buckets": 10,
+    "description": "Session restore: Time to JSON serialize session data (ms)"
+  },
+  "FX_SESSION_RESTORE_READ_FILE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Session restore: Time to read the session data from the file on disk (ms)"
+  },
+  "FX_SESSION_RESTORE_WRITE_FILE_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Session restore: Time to write the session data to the file on disk (ms)"
+  },
+  "FX_SESSION_RESTORE_CORRUPT_FILE": {
+    "kind": "boolean",
+    "description": "Session restore: Whether the file read on startup contained parse-able JSON"
+  },
+  "INNERWINDOWS_WITH_MUTATION_LISTENERS": {
+    "kind": "boolean",
+    "description": "Deleted or to-be-reused innerwindow which has had mutation event listeners."
+  },
+  "XUL_FOREGROUND_REFLOW_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "XUL reflows in foreground windows (ms)"
+  },
+  "XUL_BACKGROUND_REFLOW_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "XUL reflows in background windows (ms)"
+  },
+  "HTML_FOREGROUND_REFLOW_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "HTML reflows in foreground windows (ms)"
+  },
+  "HTML_BACKGROUND_REFLOW_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "HTML reflows in background windows (ms)"
+  },
+  "XUL_INITIAL_FRAME_CONSTRUCTION": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "initial xul frame construction"
+  },
+  "XMLHTTPREQUEST_ASYNC_OR_SYNC": {
+    "kind": "boolean",
+    "description": "Type of XMLHttpRequest, async or sync"
+  },
+  "MULTIPART_XHR_RESPONSE": {
+    "kind": "boolean",
+    "description": "XMLHttpRequest response was of type multipart/x-mixed-replace."
+  },
+  "PRIVATE_BROWSING_TRANSITION_ENTER_PREPARATION_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on private browsing enter transition, excluding session restore (ms)"
+  },
+  "PRIVATE_BROWSING_TRANSITION_ENTER_TOTAL_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent on private browsing enter transition, including session restore (ms)"
+  },
+  "PRIVATE_BROWSING_TRANSITION_EXIT_PREPARATION_MS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Time spent on private browsing exit transition, excluding session restore (ms)"
+  },
+  "PRIVATE_BROWSING_TRANSITION_EXIT_TOTAL_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 50,
+    "description": "Time spent on private browsing exit transition, including session restore (ms)"
+  },
+  "DOM_TIMERS_FIRED_PER_NATIVE_TIMEOUT": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "DOM: Timer handlers called per native timer expiration"
+  },
+  "DOM_TIMERS_RECENTLY_SET": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "DOM: setTimeout/setInterval calls recently (last 30s or more)"
+  },
+  "DOM_RANGE_DETACHED": {
+    "kind": "boolean",
+    "description": "DOM: Ranges that are detached on destruction (bug 702948)"
+  },
+  "GLOBALDOMSTORAGE_KEY_SIZE_BYTES": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "DOM storage: size of keys stored in globalStorage"
+  },
+  "GLOBALDOMSTORAGE_VALUE_SIZE_BYTES": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "DOM storage: size of values stored in globalStorage"
+  },
+  "LOCALDOMSTORAGE_KEY_SIZE_BYTES": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "DOM storage: size of keys stored in localStorage"
+  },
+  "LOCALDOMSTORAGE_VALUE_SIZE_BYTES": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "DOM storage: size of values stored in localStorage"
+  },
+  "SESSIONDOMSTORAGE_KEY_SIZE_BYTES": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "DOM storage: size of keys stored in sessionStorage"
+  },
+  "SESSIONDOMSTORAGE_VALUE_SIZE_BYTES": {
+    "kind": "exponential",
+    "low": 1024,
+    "high": "32768",
+    "n_buckets": 10,
+    "description": "DOM storage: size of values stored in sessionStorage"
+  },
+  "RANGE_CHECKSUM_ERRORS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Number of histograms with range checksum errors"
+  },
+  "BUCKET_ORDER_ERRORS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Number of histograms with bucket order errors"
+  },
+  "TOTAL_COUNT_HIGH_ERRORS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Number of histograms with total count high errors"
+  },
+  "TOTAL_COUNT_LOW_ERRORS": {
+    "kind": "exponential",
+    "high": "3000",
+    "n_buckets": 10,
+    "description": "Number of histograms with total count low errors"
+  },
+  "TELEMETRY_TEST_FLAG": {
+    "kind": "flag",
+    "description": "a testing histogram; not meant to be touched"
+  },
+  "STARTUP_CRASH_DETECTED": {
+    "kind": "flag",
+    "description": "Whether there was a crash during the last startup"
+  },
+  "SAFE_MODE_USAGE": {
+    "kind": "enumerated",
+    "n_values": 3,
+    "description": "Whether the user is in safe mode (No, Yes, Forced)"
+  },
+  "NEWTAB_PAGE_ENABLED": {
+    "kind": "boolean",
+    "description": "New tab page is enabled."
+  },
+  "NEWTAB_PAGE_PINNED_SITES_COUNT": {
+    "kind": "exponential",
+    "high": "9",
+    "n_buckets": 10,
+    "description": "Number of pinned sites on the new tab page."
+  },
+  "NEWTAB_PAGE_BLOCKED_SITES_COUNT": {
+    "kind": "exponential",
+    "high": "100",
+    "n_buckets": 10,
+    "description": "Number of sites blocked from the new tab page."
+  },
+  "PANORAMA_INITIALIZATION_TIME_MS": {
+    "kind": "exponential",
+    "high": "10000",
+    "n_buckets": 15,
+    "description": "Time it takes to initialize Panorama (ms)"
+  },
+  "PANORAMA_GROUPS_COUNT": {
+    "kind": "exponential",
+    "high": "25",
+    "n_buckets": 15,
+    "description": "Number of groups in Panorama"
+  },
+  "PANORAMA_STACKED_GROUPS_COUNT": {
+    "kind": "exponential",
+    "high": "25",
+    "n_buckets": 15,
+    "description": "Number of stacked groups in Panorama"
+  },
+  "PANORAMA_MEDIAN_TABS_IN_GROUPS_COUNT": {
+    "kind": "exponential",
+    "high": "100",
+    "n_buckets": 15,
+    "description": "Median of tabs in groups in Panorama"
+  },
+  "BROWSERPROVIDER_XUL_IMPORT_TIME": {
+    "kind": "exponential",
+    "low": 20,
+    "high": "600000",
+    "n_buckets": 20,
+    "description": "Time for the initial conversion of a XUL places database (ms)",
+    "cpp_guard": "ANDROID"
+  },
+  "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS": {
+    "kind": "exponential",
+    "high": "50000",
+    "n_buckets": 20,
+    "description": "Number of bookmarks in the original XUL places database",
+    "cpp_guard": "ANDROID"
+  },
+  "BROWSERPROVIDER_XUL_IMPORT_HISTORY": {
+    "kind": "exponential",
+    "high": "1000000",
+    "n_buckets": 20,
+    "description": "Number of history entries in the original XUL places database",
+    "cpp_guard": "ANDROID"
+  },
+  "OUT_OF_MEMORY_KILLED": {
+    "kind": "flag",
+    "description": "Killed due to an OOM condition",
+    "cpp_guard": "ANDROID"
+  },
+  "SECURITY_UI": {
+    "kind": "enumerated",
+    "n_values": 100,
+    "description": "Security UI Telemetry"
+  }
+}
--- a/toolkit/components/telemetry/Makefile.in
+++ b/toolkit/components/telemetry/Makefile.in
@@ -21,17 +21,17 @@ IS_COMPONENT = 1
 
 LIBRARY_NAME = telemetry
 
 EXPORTS_NAMESPACES = mozilla
 
 EXPORTS_mozilla = \
   Telemetry.h \
   ProcessedStack.h \
-  TelemetryHistograms.h \
+  TelemetryHistogramEnums.h \
   $(NULL)
 
 XPIDLSRCS = \
   nsITelemetry.idl \
   $(NULL)
 
 EXTRA_COMPONENTS = \
   TelemetryPing.manifest \
@@ -55,8 +55,21 @@ TEST_DIRS += tests
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
+
+histograms_file := $(srcdir)/Histograms.json
+histogram_enum_file := TelemetryHistogramEnums.h
+histogram_data_file := TelemetryHistogramData.inc
+
+$(histogram_enum_file): $(histograms_file) $(srcdir)/gen-histogram-enum.py
+	$(PYTHON) $(srcdir)/gen-histogram-enum.py $< > $@
+$(histogram_data_file): $(histograms_file) $(srcdir)/gen-histogram-data.py
+	$(PYTHON) $(srcdir)/gen-histogram-data.py $< > $@
+
+Telemetry.$(OBJ_SUFFIX): $(histogram_data_file)
+
+GARBAGE += $(histogram_data_file) $(histogram_enum_file)
--- a/toolkit/components/telemetry/Telemetry.cpp
+++ b/toolkit/components/telemetry/Telemetry.cpp
@@ -190,38 +190,17 @@ struct TelemetryHistogram {
   const char *id;
   uint32_t min;
   uint32_t max;
   uint32_t bucketCount;
   uint32_t histogramType;
   const char *comment;
 };
 
-// Perform the checks at the beginning of HistogramGet at compile time, so
-// that if people add incorrect histogram definitions, they get compiler
-// errors.
-#define HISTOGRAM(id, min, max, bucket_count, histogram_type, b) \
-  MOZ_STATIC_ASSERT(nsITelemetry::HISTOGRAM_ ## histogram_type == nsITelemetry::HISTOGRAM_BOOLEAN || \
-                    nsITelemetry::HISTOGRAM_ ## histogram_type == nsITelemetry::HISTOGRAM_FLAG || \
-                    (min < max && bucket_count > 2 && min >= 1), \
-                    "Incorrect histogram definitions were found");
-
-#include "TelemetryHistograms.h"
-
-#undef HISTOGRAM
-
-const TelemetryHistogram gHistograms[] = {
-#define HISTOGRAM(id, min, max, bucket_count, histogram_type, comment) \
-  { NS_STRINGIFY(id), min, max, bucket_count, \
-    nsITelemetry::HISTOGRAM_ ## histogram_type, comment },
-
-#include "TelemetryHistograms.h"
-
-#undef HISTOGRAM
-};
+#include "TelemetryHistogramData.inc"
 bool gCorruptHistograms[Telemetry::HistogramCount];
 
 bool
 TelemetryHistogramType(Histogram *h, uint32_t *result)
 {
   switch (h->histogram_type()) {
   case Histogram::HISTOGRAM:
     *result = nsITelemetry::HISTOGRAM_EXPONENTIAL;
--- a/toolkit/components/telemetry/Telemetry.h
+++ b/toolkit/components/telemetry/Telemetry.h
@@ -17,24 +17,17 @@
 
 namespace base {
   class Histogram;
 }
 
 namespace mozilla {
 namespace Telemetry {
 
-enum ID {
-#define HISTOGRAM(name, a, b, c, d, e) name,
-
-#include "TelemetryHistograms.h"
-
-#undef HISTOGRAM
-HistogramCount
-};
+#include "TelemetryHistogramEnums.h"
 
 /**
  * Initialize the Telemetry service on the main thread at startup.
  */
 void Init();
 
 /**
  * Adds sample to a histogram defined in TelemetryHistograms.h
deleted file mode 100644
--- a/toolkit/components/telemetry/TelemetryHistograms.h
+++ /dev/null
@@ -1,539 +0,0 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This file lists Telemetry histograms collected by Mozilla. The format is
- *
- *    HISTOGRAM(id, minimum, maximum, bucket count, histogram kind,
- *              human-readable description for about:telemetry)
- *
- * This file is the master list of telemetry histograms reported to Mozilla servers.
- * The other data reported by telemetry is listed on https://wiki.mozilla.org/Privacy/Reviews/Telemetry/Measurements
- *
- * Please note that only BOOLEAN histograms are allowed to have a minimum value
- * of zero, and that bucket counts should be >= 3.
- */
-
-/* Convenience macro for BOOLEAN histograms. */
-#define HISTOGRAM_BOOLEAN(id, message) HISTOGRAM(id, 0, 1, 2, BOOLEAN, message)
-/* Likewise for FLAG histograms. */
-#define HISTOGRAM_FLAG(id, message) HISTOGRAM(id, 0, 1, 2, FLAG, message)
-/* Convenience macro for LINEAR histograms where we want buckets from 1 to N, inclusive. */
-#define HISTOGRAM_ENUMERATED_VALUES(id, n, message) \
-  HISTOGRAM(id, 1, n, n+1, LINEAR, message)
-
-/**
- * a11y telemetry
- */
-HISTOGRAM_FLAG(A11Y_INSTANTIATED_FLAG, "has accessibility support been instantiated")
-HISTOGRAM_ENUMERATED_VALUES(A11Y_CONSUMERS, 11, "Accessibility client by enum id")
-HISTOGRAM_FLAG(A11Y_ISIMPLEDOM_USAGE_FLAG, "have the ISimpleDOM* accessibility interfaces been used")
-HISTOGRAM_FLAG(A11Y_IATABLE_USAGE_FLAG, "has the IAccessibleTable accessibility interface been used")
-HISTOGRAM_FLAG(A11Y_XFORMS_USAGE_FLAG, "has XForms accessibility been instantiated")
-HISTOGRAM(A11Y_UPDATE_TIME, 1, 10000, 50, EXPONENTIAL, "time spent updating accessibility (ms)")
-
-/**
- * Cycle collector telemetry
- */
-HISTOGRAM(CYCLE_COLLECTOR, 1, 10000, 50, EXPONENTIAL, "Time spent on one cycle collection (ms)")
-HISTOGRAM(CYCLE_COLLECTOR_VISITED_REF_COUNTED, 1, 300000, 50, EXPONENTIAL, "Number of ref counted objects visited by the cycle collector")
-HISTOGRAM(CYCLE_COLLECTOR_VISITED_GCED, 1, 300000, 50, EXPONENTIAL, "Number of JS objects visited by the cycle collector")
-HISTOGRAM(CYCLE_COLLECTOR_COLLECTED, 1, 100000, 50, EXPONENTIAL, "Number of objects collected by the cycle collector")
-HISTOGRAM_BOOLEAN(CYCLE_COLLECTOR_NEED_GC, "Needed garbage collection before cycle collection.")
-HISTOGRAM(CYCLE_COLLECTOR_TIME_BETWEEN, 1, 120, 50, EXPONENTIAL, "Time spent in between cycle collections (seconds)")
-HISTOGRAM(CYCLE_COLLECTOR_CONTENT_UNBIND, 1, 10000, 50, EXPONENTIAL, "Time spent on one ContentUnbinder (ms)")
-HISTOGRAM(FORGET_SKIPPABLE_MAX, 1, 10000, 50, EXPONENTIAL, "Max time spent on one forget skippable (ms)")
-
-/**
- * GC telemetry
- */
-HISTOGRAM_ENUMERATED_VALUES(GC_REASON_2, js::gcreason::NUM_TELEMETRY_REASONS, "Reason (enum value) for initiating a GC")
-HISTOGRAM_BOOLEAN(GC_IS_COMPARTMENTAL, "Is it a compartmental GC?")
-HISTOGRAM(GC_MS, 1, 10000, 50, EXPONENTIAL, "Time spent running JS GC (ms)")
-HISTOGRAM(GC_MAX_PAUSE_MS, 1, 1000, 50, LINEAR, "Longest GC slice in a GC (ms)")
-HISTOGRAM(GC_MARK_MS, 1, 10000, 50, EXPONENTIAL, "Time spent running JS GC mark phase (ms)")
-HISTOGRAM(GC_SWEEP_MS, 1, 10000, 50, EXPONENTIAL, "Time spent running JS GC sweep phase (ms)")
-HISTOGRAM(GC_MARK_ROOTS_MS, 1, 200, 50, LINEAR, "Time spent marking GC roots (ms)")
-HISTOGRAM(GC_MARK_GRAY_MS, 1, 200, 50, LINEAR, "Time spent marking gray GC objects (ms)")
-HISTOGRAM(GC_SLICE_MS, 1, 10000, 50, EXPONENTIAL, "Time spent running a JS GC slice (ms)")
-HISTOGRAM(GC_MMU_50, 1, 100, 20, LINEAR, "Minimum percentage of time spent outside GC over any 50ms window")
-HISTOGRAM_BOOLEAN(GC_RESET, "Was an incremental GC canceled?")
-HISTOGRAM_BOOLEAN(GC_INCREMENTAL_DISABLED, "Is incremental GC permanently disabled?")
-HISTOGRAM_BOOLEAN(GC_NON_INCREMENTAL, "Was the GC non-incremental?")
-HISTOGRAM(GC_SCC_SWEEP_TOTAL_MS, 1, 500, 50, LINEAR, "Time spent sweeping compartment SCCs (ms)")
-HISTOGRAM(GC_SCC_SWEEP_MAX_PAUSE_MS, 1, 500, 50, LINEAR, "Time spent sweeping slowest compartment SCC (ms)")
-
-HISTOGRAM(TELEMETRY_PING, 1, 3000, 10, EXPONENTIAL, "Time taken to submit telemetry info (ms)")
-HISTOGRAM_BOOLEAN(TELEMETRY_SUCCESS,  "Successful telemetry submission")
-HISTOGRAM(MEMORY_JS_COMPARTMENTS_SYSTEM, 1, 1000, 50, EXPONENTIAL, "Total JavaScript compartments used for add-ons and internals.")
-HISTOGRAM(MEMORY_JS_COMPARTMENTS_USER, 1, 1000, 50, EXPONENTIAL, "Total JavaScript compartments used for web pages")
-HISTOGRAM(MEMORY_JS_GC_HEAP, 1024, 512 * 1024, 50, EXPONENTIAL, "Memory used by the garbage-collected JavaScript heap (KB)")
-HISTOGRAM(MEMORY_RESIDENT, 32 * 1024, 1024 * 1024, 50, EXPONENTIAL, "Resident memory size (KB)")
-HISTOGRAM(MEMORY_STORAGE_SQLITE, 1024, 512 * 1024, 50, EXPONENTIAL, "Memory used by SQLite (KB)")
-HISTOGRAM(MEMORY_IMAGES_CONTENT_USED_UNCOMPRESSED, 1024, 1024 * 1024, 50, EXPONENTIAL, "Memory used for uncompressed, in-use content images (KB)")
-HISTOGRAM(MEMORY_HEAP_ALLOCATED, 1024, 1024 * 1024, 50, EXPONENTIAL, "Heap memory allocated (KB)")
-HISTOGRAM(MEMORY_HEAP_COMMITTED_UNUSED, 1024, 512 * 1024, 50, EXPONENTIAL, "Committed, unused heap memory (KB)")
-HISTOGRAM(MEMORY_HEAP_COMMITTED_UNUSED_RATIO, 1, 100, 25, LINEAR, "Ratio of committed, unused memory to allocated memory in the heap (percentage).")
-HISTOGRAM(MEMORY_EXPLICIT, 1024, 1024 * 1024, 50, EXPONENTIAL, "Explicit memory allocations (KB)")
-HISTOGRAM(GHOST_WINDOWS, 1, 128, 8, EXPONENTIAL, "Number of ghost windows")
-#if defined(XP_MACOSX)
-HISTOGRAM(MEMORY_FREE_PURGED_PAGES_MS, 1, 1024, 10, EXPONENTIAL, "Time(ms) to purge MADV_FREE'd heap pages.")
-#elif defined(XP_WIN)
-HISTOGRAM(LOW_MEMORY_EVENTS_VIRTUAL, 1, 1024, 21, EXPONENTIAL, "Number of low-virtual-memory events fired since last ping")
-HISTOGRAM(LOW_MEMORY_EVENTS_PHYSICAL, 1, 1024, 21, EXPONENTIAL, "Number of low-physical-memory events fired since last ping")
-HISTOGRAM(LOW_MEMORY_EVENTS_COMMIT_SPACE, 1, 1024, 21, EXPONENTIAL, "Number of low-commit-space events fired since last ping")
-#endif
-
-#if defined(XP_WIN)
-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")
-HISTOGRAM(PAGE_FAULTS_HARD, 8, 64 * 1024, 13, EXPONENTIAL, "Hard page faults (since last telemetry ping)")
-#endif
-HISTOGRAM(FONTLIST_INITOTHERFAMILYNAMES, 1, 30000, 50, EXPONENTIAL, "Time(ms) spent on reading other family names from all fonts")
-HISTOGRAM(FONTLIST_INITFACENAMELISTS, 1, 30000, 50, EXPONENTIAL, "Time(ms) spent on reading family names from all fonts")
-#if defined(XP_WIN)
-HISTOGRAM(DWRITEFONT_INITFONTLIST_TOTAL, 1, 30000, 10, EXPONENTIAL, "gfxDWriteFontList::InitFontList Total (ms)")
-HISTOGRAM(DWRITEFONT_INITFONTLIST_INIT, 1, 30000, 10, EXPONENTIAL, "gfxDWriteFontList::InitFontList init (ms)")
-HISTOGRAM(DWRITEFONT_INITFONTLIST_GDI, 1, 30000, 10, EXPONENTIAL, "gfxDWriteFontList::InitFontList GdiInterop object (ms)")
-HISTOGRAM(DWRITEFONT_DELAYEDINITFONTLIST_TOTAL, 1, 30000, 10, EXPONENTIAL, "gfxDWriteFontList::DelayedInitFontList Total (ms)")
-HISTOGRAM(DWRITEFONT_DELAYEDINITFONTLIST_COUNT, 1, 10000, 10, EXPONENTIAL, "gfxDWriteFontList::DelayedInitFontList Font Family Count")
-HISTOGRAM_BOOLEAN(DWRITEFONT_DELAYEDINITFONTLIST_GDI_TABLE, "gfxDWriteFontList::DelayedInitFontList GDI Table Access")
-HISTOGRAM(DWRITEFONT_DELAYEDINITFONTLIST_COLLECT, 1, 30000, 10, EXPONENTIAL, "gfxDWriteFontList::DelayedInitFontList GetSystemFontCollection (ms)")
-HISTOGRAM(DWRITEFONT_DELAYEDINITFONTLIST_ITERATE, 1, 30000, 10, EXPONENTIAL, "gfxDWriteFontList::DelayedInitFontList iterate over families (ms)")
-HISTOGRAM(GDI_INITFONTLIST_TOTAL, 1, 30000, 10, EXPONENTIAL, "gfxGDIFontList::InitFontList Total (ms)")
-#elif defined(XP_MACOSX)
-HISTOGRAM(MAC_INITFONTLIST_TOTAL, 1, 30000, 10, EXPONENTIAL, "gfxMacPlatformFontList::InitFontList Total (ms)")
-#endif
-
-HISTOGRAM(SYSTEM_FONT_FALLBACK, 1, 100000, 50, EXPONENTIAL, "System font fallback (us)")
-HISTOGRAM(SYSTEM_FONT_FALLBACK_FIRST, 1, 40000, 20, EXPONENTIAL, "System font fallback, first call (ms)")
-HISTOGRAM(SYSTEM_FONT_FALLBACK_SCRIPT, 1, 110, 111, LINEAR, "System font fallback script")
-
-HISTOGRAM(STARTUP_CACHE_AGE_HOURS, 1, 3000, 20, EXPONENTIAL, "Startup cache age (hours)")
-
-/**
- * Word cache - one count cache hits, another for misses
- * Note: range and number of buckets must match
- */
-HISTOGRAM(WORD_CACHE_HITS, 1, 256, 30, EXPONENTIAL, "Word cache hits (chars)")
-HISTOGRAM(WORD_CACHE_MISSES, 1, 256, 30, EXPONENTIAL, "Word cache misses (chars)")
-
-HISTOGRAM_BOOLEAN(FONT_CACHE_HIT, "font cache hit")
-HISTOGRAM_BOOLEAN(BAD_FALLBACK_FONT, "system fallback font can't be used")
-
-HISTOGRAM_BOOLEAN(SHUTDOWN_OK, "Did the browser start after a successful shutdown")
-
-HISTOGRAM(IMAGE_DECODE_LATENCY, 50,  5000000, 100, EXPONENTIAL, "Time spent decoding an image chunk (us)")
-HISTOGRAM(IMAGE_DECODE_TIME,    50, 50000000, 100, EXPONENTIAL, "Time spent decoding an image (us)")
-HISTOGRAM(IMAGE_DECODE_ON_DRAW_LATENCY,  50, 50000000, 100, EXPONENTIAL, "Time from starting a decode to it showing up on the screen (us)")
-HISTOGRAM(IMAGE_DECODE_CHUNKS, 1,  500, 50, EXPONENTIAL, "Number of chunks per decode attempt")
-HISTOGRAM(IMAGE_DECODE_COUNT, 1,  500, 50, EXPONENTIAL, "Decode count")
-HISTOGRAM(IMAGE_DECODE_SPEED_JPEG, 500, 50000000,  50, EXPONENTIAL, "JPEG image decode speed (Kbytes/sec)")
-HISTOGRAM(IMAGE_DECODE_SPEED_GIF,  500, 50000000,  50, EXPONENTIAL, "GIF image decode speed (Kbytes/sec)")
-HISTOGRAM(IMAGE_DECODE_SPEED_PNG,  500, 50000000,  50, EXPONENTIAL, "PNG image decode speed (Kbytes/sec)")
-
-HISTOGRAM_BOOLEAN(CANVAS_2D_USED, "2D canvas used")
-HISTOGRAM_BOOLEAN(CANVAS_WEBGL_USED, "WebGL canvas used")
-
-/**
- * Networking telemetry
- */
-HISTOGRAM(TOTAL_CONTENT_PAGE_LOAD_TIME, 100, 30000, 100, EXPONENTIAL, "HTTP: Total page load time (ms)")
-HISTOGRAM(HTTP_SUBITEM_OPEN_LATENCY_TIME, 1, 30000, 50, EXPONENTIAL, "HTTP subitem: Page start -> subitem open() (ms)")
-HISTOGRAM(HTTP_SUBITEM_FIRST_BYTE_LATENCY_TIME, 1, 30000, 50, EXPONENTIAL, "HTTP subitem: Page start -> first byte received for subitem reply (ms)")
-HISTOGRAM(HTTP_REQUEST_PER_PAGE, 1, 1000, 50, EXPONENTIAL, "HTTP: Requests per page (count)")
-HISTOGRAM(HTTP_REQUEST_PER_PAGE_FROM_CACHE, 1, 101, 102, LINEAR, "HTTP: Requests serviced from cache (%)")
-HISTOGRAM(HTTP_REQUEST_PER_CONN, 1, 1000, 50, EXPONENTIAL, "HTTP: requests per connection")
-HISTOGRAM(HTTP_KBREAD_PER_CONN, 1, 3000, 50, EXPONENTIAL, "HTTP: KB read per connection")
-
-#define _HTTP_HIST(name, label) \
-  HISTOGRAM(name, 1, 30000, 50, EXPONENTIAL, "HTTP " label) \
-
-#define HTTP_HISTOGRAMS(prefix, labelprefix) \
-  _HTTP_HIST(HTTP_##prefix##_DNS_ISSUE_TIME, labelprefix "open() -> DNS request issued (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_DNS_LOOKUP_TIME, labelprefix "DNS lookup time (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_TCP_CONNECTION, labelprefix "TCP connection setup (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_OPEN_TO_FIRST_SENT, labelprefix "Open -> first byte of request sent (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_FIRST_SENT_TO_LAST_RECEIVED, labelprefix "First byte of request sent -> last byte of response received (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_OPEN_TO_FIRST_RECEIVED, labelprefix "Open -> first byte of reply received (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_OPEN_TO_FIRST_FROM_CACHE, labelprefix "Open -> cache read start (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_CACHE_READ_TIME, labelprefix "Cache read time (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_REVALIDATION, labelprefix "Positive cache validation time (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_COMPLETE_LOAD, labelprefix "Overall load time - all (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_COMPLETE_LOAD_CACHED, labelprefix "Overall load time - cache hits (ms)") \
-  _HTTP_HIST(HTTP_##prefix##_COMPLETE_LOAD_NET, labelprefix "Overall load time - network (ms)") \
-
-HTTP_HISTOGRAMS(PAGE, "page: ")
-HTTP_HISTOGRAMS(SUB, "subitem: ")
-
-// SPDY_VERSION was renamed to SPDY_VERSION2 as the old version did not use enumerated values
-HISTOGRAM_ENUMERATED_VALUES(SPDY_VERSION2, 48, "SPDY: Protocol Version Used")
-HISTOGRAM(SPDY_PARALLEL_STREAMS, 1, 1000, 50, EXPONENTIAL, "SPDY: Streams concurrent active per connection")
-HISTOGRAM(SPDY_REQUEST_PER_CONN, 1, 1000, 50, EXPONENTIAL,  "SPDY: Streams created per connection")
-HISTOGRAM(SPDY_SERVER_INITIATED_STREAMS, 1, 100000, 250, EXPONENTIAL,  "SPDY: Streams recevied per connection")
-HISTOGRAM(SPDY_CHUNK_RECVD, 1, 1000, 100, EXPONENTIAL,  "SPDY: Recvd Chunk Size (rounded to KB)")
-HISTOGRAM(SPDY_SYN_SIZE, 20, 20000, 50, EXPONENTIAL,  "SPDY: SYN Frame Header Size")
-HISTOGRAM(SPDY_SYN_RATIO, 1, 99, 20, LINEAR,  "SPDY: SYN Frame Header Ratio (lower better)")
-HISTOGRAM(SPDY_SYN_REPLY_SIZE, 16, 20000, 50, EXPONENTIAL,  "SPDY: SYN Reply Header Size")
-HISTOGRAM(SPDY_SYN_REPLY_RATIO, 1, 99, 20, LINEAR,  "SPDY: SYN Reply Header Ratio (lower better)")
-HISTOGRAM_BOOLEAN(SPDY_NPN_CONNECT,  "SPDY: NPN Negotiated")
-HISTOGRAM_BOOLEAN(SPDY_NPN_JOIN,  "SPDY: Coalesce Succeeded")
-HISTOGRAM(SPDY_KBREAD_PER_CONN, 1, 3000, 50, EXPONENTIAL, "SPDY: KB read per connection")
-HISTOGRAM(SPDY_PING_EXPERIMENT_PASS, 10, 355, 64, LINEAR, "SPDY: Ping Interval Passed")
-HISTOGRAM(SPDY_PING_EXPERIMENT_FAIL, 10, 355, 64, LINEAR, "SPDY: Ping Interval Failed")
-
-HISTOGRAM(SPDY_SETTINGS_UL_BW, 1, 10000, 100, EXPONENTIAL,  "SPDY: Settings Upload Bandwidth")
-HISTOGRAM(SPDY_SETTINGS_DL_BW, 1, 10000, 100, EXPONENTIAL,  "SPDY: Settings Download Bandwidth")
-HISTOGRAM(SPDY_SETTINGS_RTT, 1, 1000, 100, EXPONENTIAL,  "SPDY: Settings RTT")
-HISTOGRAM(SPDY_SETTINGS_MAX_STREAMS, 1, 5000, 100, EXPONENTIAL,  "SPDY: Settings Max Streams parameter")
-HISTOGRAM(SPDY_SETTINGS_CWND, 1, 500, 50, EXPONENTIAL,  "SPDY: Settings CWND (packets)")
-HISTOGRAM(SPDY_SETTINGS_RETRANS, 1, 100, 50, EXPONENTIAL,  "SPDY: Retransmission Rate")
-HISTOGRAM(SPDY_SETTINGS_IW, 1, 1000, 50, EXPONENTIAL,  "SPDY: Settings IW (rounded to KB)")
-
-#undef _HTTP_HIST
-#undef HTTP_HISTOGRAMS
-
-HISTOGRAM_ENUMERATED_VALUES(DISK_CACHE_CORRUPT_DETAILS, 50, "Why the HTTP disk cache was corrupted at startup")
-HISTOGRAM_BOOLEAN(DISK_CACHE_REDUCTION_TRIAL, "Stores 1 if the cache would be clean with the disk cache corruption plan of Bug 105843")
-HISTOGRAM_ENUMERATED_VALUES(HTTP_CACHE_DISPOSITION_2,         5, "HTTP Cache Hit, Reval, Failed-Reval, Miss")
-HISTOGRAM_ENUMERATED_VALUES(HTTP_DISK_CACHE_DISPOSITION_2,    5, "HTTP Disk Cache Hit, Reval, Failed-Reval, Miss")
-HISTOGRAM_ENUMERATED_VALUES(HTTP_MEMORY_CACHE_DISPOSITION_2,  5, "HTTP Memory Cache Hit, Reval, Failed-Reval, Miss")
-HISTOGRAM_ENUMERATED_VALUES(HTTP_OFFLINE_CACHE_DISPOSITION_2, 5, "HTTP Offline Cache Hit, Reval, Failed-Reval, Miss")
-HISTOGRAM(CACHE_DEVICE_SEARCH_2, 1, 10000, 50, EXPONENTIAL, "Time to search cache (ms)")
-HISTOGRAM(CACHE_MEMORY_SEARCH_2, 1, 10000, 50, EXPONENTIAL, "Time to search memory cache (ms)")
-HISTOGRAM(CACHE_DISK_SEARCH_2, 1, 10000, 50, EXPONENTIAL, "Time to search disk cache (ms)")
-HISTOGRAM(CACHE_OFFLINE_SEARCH_2, 1, 10000, 50, EXPONENTIAL, "Time to search offline cache (ms)")
-HISTOGRAM(HTTP_DISK_CACHE_OVERHEAD, 1, 32000000, 100, EXPONENTIAL, "HTTP Disk cache memory overhead (bytes)")
-HISTOGRAM_BOOLEAN(CACHE_LM_INCONSISTENT, "Cache discovered inconsistent last-modified entry")
-HISTOGRAM(CACHE_SERVICE_LOCK_WAIT_2, 1, 10000, 50, EXPONENTIAL, "Time spent waiting on the cache service lock (ms)")
-HISTOGRAM(CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_2, 1, 10000, 50, EXPONENTIAL, "Time spent waiting on the cache service lock on the main thread (ms)")
-HISTOGRAM_BOOLEAN(DISK_CACHE_SMART_SIZE_USING_OLD_MAX, "Whether we are using the old default cache smart size")
-
-#define CACHE_LOCK_HISTOGRAM(x) \
-  HISTOGRAM(CACHE_SERVICE_LOCK_WAIT_MAINTHREAD_##x, 1, 10 * 1000, 50, EXPONENTIAL, "Time spent waiting on the cache service lock (ms) on the main thread in " #x)
-
-CACHE_LOCK_HISTOGRAM(NSSETDISKSMARTSIZECALLBACK_NOTIFY)
-CACHE_LOCK_HISTOGRAM(NSPROCESSREQUESTEVENT_RUN)
-CACHE_LOCK_HISTOGRAM(NSOUTPUTSTREAMWRAPPER_LAZYINIT)
-CACHE_LOCK_HISTOGRAM(NSOUTPUTSTREAMWRAPPER_CLOSE)
-CACHE_LOCK_HISTOGRAM(NSINPUTSTREAMWRAPPER_LAZYINIT)
-CACHE_LOCK_HISTOGRAM(NSEVICTDISKCACHEENTRIESEVENT_RUN)
-CACHE_LOCK_HISTOGRAM(NSDOOMEVENT_RUN)
-CACHE_LOCK_HISTOGRAM(NSDISKCACHESTREAMIO_WRITE)
-CACHE_LOCK_HISTOGRAM(NSDISKCACHESTREAMIO_CLOSEOUTPUTSTREAM)
-CACHE_LOCK_HISTOGRAM(NSDISKCACHEDEVICEDEACTIVATEENTRYEVENT_RUN)
-CACHE_LOCK_HISTOGRAM(NSDISKCACHEBINDING_DESTRUCTOR)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SHUTDOWN)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETOFFLINECACHEENABLED)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETOFFLINECACHECAPACITY)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETMEMORYCACHE)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETDISKSMARTSIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETDISKCACHEMAXENTRYSIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETMEMORYCACHEMAXENTRYSIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETDISKCACHEENABLED)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_SETDISKCACHECAPACITY)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_OPENCACHEENTRY)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_ONPROFILESHUTDOWN)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_ONPROFILECHANGED)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_LEAVEPRIVATEBROWSING)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_ISSTORAGEENABLEDFORPOLICY)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_GETCACHEIOTARGET)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_EVICTENTRIESFORCLIENT)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_DOOM)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETPREDICTEDDATASIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETDATASIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETSTORAGEDATASIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_REQUESTDATASIZECHANGE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETDATASIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_OPENINPUTSTREAM)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_OPENOUTPUTSTREAM)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETCACHEELEMENT)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETCACHEELEMENT)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETSTORAGEPOLICY)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETSTORAGEPOLICY)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETFILE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETSECURITYINFO)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETSECURITYINFO)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_DOOMANDFAILPENDINGREQUESTS)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_MARKVALID)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_CLOSE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETMETADATAELEMENT)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETMETADATAELEMENT)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_VISITMETADATA)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_SETEXPIRATIONTIME)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_ISSTREAMBASED)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETLASTMODIFIED)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETEXPIRATIONTIME)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETKEY)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETFETCHCOUNT)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETDEVICEID)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_PROCESSREQUEST)
-CACHE_LOCK_HISTOGRAM(NSCACHESERVICE_VISITENTRIES)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETPREDICTEDDATASIZE)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETLASTFETCHED)
-CACHE_LOCK_HISTOGRAM(NSCACHEENTRYDESCRIPTOR_GETCLIENTID)
-CACHE_LOCK_HISTOGRAM(NSBLOCKONCACHETHREADEVENT_RUN)
-CACHE_LOCK_HISTOGRAM(NSDISKCACHEMAP_REVALIDATION)
-
-#undef CACHE_LOCK_HISTOGRAM
- 
-// DNS_LOOKUP_METHOD was renamed to DNS_LOOKUP_METHOD2 as the old version did not use enumerated values
-HISTOGRAM_ENUMERATED_VALUES(DNS_LOOKUP_METHOD2, 16, "DNS Lookup Type (hit, renewal, negative-hit, literal, overflow, network-first, network-shared)")
-HISTOGRAM(DNS_CLEANUP_AGE, 1, 1440, 50, EXPONENTIAL, "DNS Cache Entry Age at Removal Time (minutes)")
-HISTOGRAM(DNS_LOOKUP_TIME, 1, 60000, 50, EXPONENTIAL, "Time for a successful DNS OS resolution (msec)")
-HISTOGRAM(DNS_RENEWAL_TIME, 1, 60000, 50, EXPONENTIAL, "Time for a renewed DNS OS resolution (msec)")
-HISTOGRAM(DNS_FAILED_LOOKUP_TIME, 1, 60000, 50, EXPONENTIAL, "Time for an unsuccessful DNS OS resolution (msec)")
-
-HISTOGRAM(FIND_PLUGINS, 1, 3000, 10, EXPONENTIAL, "Time spent scanning filesystem for plugins (ms)")
-HISTOGRAM(CHECK_JAVA_ENABLED, 1, 3000, 10, EXPONENTIAL, "Time spent checking if Java is enabled (ms)")
-HISTOGRAM(PLUGIN_SHUTDOWN_MS, 1, 5000, 20, EXPONENTIAL, "Time spent shutting down plugins (ms)")
-
-/* Define 2 histograms: MOZ_SQLITE_(NAME)_MS and
- * MOZ_SQLITE_(NAME)_MAIN_THREAD_MS. These are meant to be used by
- * IOThreadAutoTimer which relies on _MAIN_THREAD_MS histogram being
- * "+ 1" away from MOZ_SQLITE_(NAME)_MS.
- */
-#define SQLITE_TIME_SPENT(NAME, DESC) \
-  HISTOGRAM(MOZ_SQLITE_ ## NAME ## _MS, 1, 3000, 10, EXPONENTIAL, DESC) \
-  HISTOGRAM(MOZ_SQLITE_ ## NAME ## _MAIN_THREAD_MS, 1, 3000, 10, EXPONENTIAL, DESC)
-
-#define SQLITE_TIME_PER_FILE(NAME, DESC) \
-  SQLITE_TIME_SPENT(OTHER_ ## NAME, DESC) \
-  SQLITE_TIME_SPENT(PLACES_ ## NAME, DESC) \
-  SQLITE_TIME_SPENT(COOKIES_ ## NAME, DESC) \
-  SQLITE_TIME_SPENT(WEBAPPS_ ## NAME, DESC)
-
-SQLITE_TIME_SPENT(OPEN, "Time spent on SQLite open() (ms)")
-SQLITE_TIME_SPENT(TRUNCATE, "Time spent on SQLite truncate() (ms)")
-SQLITE_TIME_PER_FILE(READ, "Time spent on SQLite read() (ms)")
-SQLITE_TIME_PER_FILE(WRITE, "Time spent on SQLite write() (ms)")
-SQLITE_TIME_PER_FILE(SYNC, "Time spent on SQLite fsync() (ms)")
-#undef SQLITE_TIME_PER_FILE
-#undef SQLITE_TIME_SPENT
-HISTOGRAM(MOZ_SQLITE_OTHER_READ_B, 1, 32768, 3, LINEAR, "SQLite read() (bytes)")
-HISTOGRAM(MOZ_SQLITE_PLACES_READ_B, 1, 32768, 3, LINEAR, "SQLite read() (bytes)")
-HISTOGRAM(MOZ_SQLITE_COOKIES_READ_B, 1, 32768, 3, LINEAR, "SQLite read() (bytes)")
-HISTOGRAM(MOZ_SQLITE_WEBAPPS_READ_B, 1, 32768, 3, LINEAR, "SQLite read() (bytes)")
-HISTOGRAM(MOZ_SQLITE_PLACES_WRITE_B, 1, 32768, 3, LINEAR, "SQLite write (bytes)")
-HISTOGRAM(MOZ_SQLITE_COOKIES_WRITE_B, 1, 32768, 3, LINEAR, "SQLite write (bytes)")
-HISTOGRAM(MOZ_SQLITE_WEBAPPS_WRITE_B, 1, 32768, 3, LINEAR, "SQLite write (bytes)")
-HISTOGRAM(MOZ_SQLITE_OTHER_WRITE_B, 1, 32768, 3, LINEAR, "SQLite write (bytes)")
-HISTOGRAM(MOZ_STORAGE_ASYNC_REQUESTS_MS, 1, 32768, 20, EXPONENTIAL, "mozStorage async requests completion (ms)")
-HISTOGRAM_BOOLEAN(MOZ_STORAGE_ASYNC_REQUESTS_SUCCESS, "mozStorage async requests success")
-HISTOGRAM_ENUMERATED_VALUES(STARTUP_MEASUREMENT_ERRORS, mozilla::StartupTimeline::MAX_EVENT_ID, "Flags errors in startup calculation()")
-HISTOGRAM(NETWORK_DISK_CACHE_OPEN, 1, 10000, 10, EXPONENTIAL, "Time spent opening disk cache (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_TRASHRENAME, 1, 10000, 10, EXPONENTIAL, "Time spent renaming bad Cache to Cache.Trash (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_DELETEDIR, 1, 10000, 10, EXPONENTIAL, "Time spent deleting disk cache (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_DELETEDIR_SHUTDOWN, 1, 10000, 10, EXPONENTIAL, "Time spent during showdown stopping thread deleting old disk cache (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_SHUTDOWN, 1, 10000, 10, EXPONENTIAL, "Total Time spent (ms) during disk cache showdown")
-HISTOGRAM(NETWORK_DISK_CACHE_SHUTDOWN_CLEAR_PRIVATE, 1, 10000, 10, EXPONENTIAL, "Time spent (ms) during showdown deleting disk cache for 'clear private data' option")
-HISTOGRAM(NETWORK_DISK_CACHE_REVALIDATION, 1, 10000, 10, EXPONENTIAL, "Total Time spent (ms) during disk cache revalidation")
-HISTOGRAM(NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE, 1, 10000, 10, EXPONENTIAL, "Time spent in nsDiskCacheOutputStream::Close() on non-main thread (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE_MAIN_THREAD, 1, 10000, 10, EXPONENTIAL, "Time spent in nsDiskCacheOutputStream::Close() on the main thread (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE_INTERNAL, 1, 10000, 10, EXPONENTIAL, "Time spent in nsDiskCacheOutputStream::CloseInternal() on non-main thread (ms)")
-HISTOGRAM(NETWORK_DISK_CACHE_OUTPUT_STREAM_CLOSE_INTERNAL_MAIN_THREAD, 1, 10000, 10, EXPONENTIAL, "Time spent in nsDiskCacheOutputStream::CloseInternal on the main thread (ms)")
-
-/**
- * Idle service telemetry
- */
-HISTOGRAM(IDLE_NOTIFY_BACK_MS, 1, 5000, 10, EXPONENTIAL, "Time spent checking for and notifying listeners that the user is back (ms)")
-HISTOGRAM(IDLE_NOTIFY_BACK_LISTENERS, 1, 100, 20, LINEAR, "Number of listeners notified that the user is back")
-HISTOGRAM(IDLE_NOTIFY_IDLE_MS, 1, 5000, 10, EXPONENTIAL, "Time spent checking for and notifying listeners that the user is idle (ms)")
-HISTOGRAM(IDLE_NOTIFY_IDLE_LISTENERS, 1, 100, 20, LINEAR, "Number of listeners notified that the user is idle")
-
-/**
- * Url-Classifier telemetry
- */
-#ifdef MOZ_URL_CLASSIFIER
-HISTOGRAM(URLCLASSIFIER_LOOKUP_TIME, 1, 500, 10, EXPONENTIAL, "Time spent per dbservice lookup (ms)")
-HISTOGRAM(URLCLASSIFIER_CL_CHECK_TIME, 1, 500, 10, EXPONENTIAL, "Time spent per classifier lookup (ms)")
-HISTOGRAM(URLCLASSIFIER_CL_UPDATE_TIME, 20, 15000, 15, EXPONENTIAL, "Time spent per classifier update (ms)")
-HISTOGRAM(URLCLASSIFIER_PS_FILELOAD_TIME, 1, 1000, 10, EXPONENTIAL, "Time spent loading PrefixSet from file (ms)")
-HISTOGRAM(URLCLASSIFIER_PS_FALLOCATE_TIME, 1, 1000, 10, EXPONENTIAL, "Time spent fallocating PrefixSet (ms)")
-HISTOGRAM(URLCLASSIFIER_PS_CONSTRUCT_TIME, 1, 5000, 15, EXPONENTIAL, "Time spent constructing PrefixSet from DB (ms)")
-HISTOGRAM(URLCLASSIFIER_LC_PREFIXES, 1, 1500000, 15, LINEAR, "Size of the prefix cache in entries")
-HISTOGRAM(URLCLASSIFIER_LC_COMPLETIONS, 1, 200, 10, EXPONENTIAL, "Size of the completion cache in entries")
-HISTOGRAM_BOOLEAN(URLCLASSIFIER_PS_FAILURE, "Did UrlClassifier fail to construct the PrefixSet?")
-#endif
-
-/**
- * Places telemetry.
- */
-HISTOGRAM(PLACES_PAGES_COUNT, 1000, 150000, 20, EXPONENTIAL, "PLACES: Number of unique pages")
-HISTOGRAM(PLACES_BOOKMARKS_COUNT, 100, 8000, 15, EXPONENTIAL, "PLACES: Number of bookmarks")
-HISTOGRAM(PLACES_TAGS_COUNT, 1, 200, 10, EXPONENTIAL, "PLACES: Number of tags")
-HISTOGRAM(PLACES_FOLDERS_COUNT, 1, 200, 10, EXPONENTIAL, "PLACES: Number of folders")
-HISTOGRAM(PLACES_KEYWORDS_COUNT, 1, 200, 10, EXPONENTIAL, "PLACES: Number of keywords")
-HISTOGRAM(PLACES_SORTED_BOOKMARKS_PERC, 1, 100, 10, LINEAR, "PLACES: Percentage of bookmarks organized in folders")
-HISTOGRAM(PLACES_TAGGED_BOOKMARKS_PERC, 1, 100, 10, LINEAR, "PLACES: Percentage of tagged bookmarks")
-HISTOGRAM(PLACES_DATABASE_FILESIZE_MB, 5, 200, 10, EXPONENTIAL, "PLACES: Database filesize (MB)")
-HISTOGRAM(PLACES_DATABASE_JOURNALSIZE_MB, 1, 50, 10, EXPONENTIAL, "PLACES: Database journal size (MB)")
-HISTOGRAM(PLACES_DATABASE_PAGESIZE_B, 1024, 32768, 10, EXPONENTIAL, "PLACES: Database page size (bytes)")
-HISTOGRAM(PLACES_DATABASE_SIZE_PER_PAGE_B, 500, 10240, 20, EXPONENTIAL, "PLACES: Average size of a place in the database (bytes)")
-HISTOGRAM_ENUMERATED_VALUES(PLACES_EXPIRATION_STEPS_TO_CLEAN2, 10, "PLACES: Expiration steps to cleanup the database")
-HISTOGRAM(PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS, 50, 500, 10, EXPONENTIAL, "PLACES: Time for first autocomplete result if > 50ms (ms)")
-HISTOGRAM(PLACES_IDLE_FRECENCY_DECAY_TIME_MS, 50, 10000, 10, EXPONENTIAL, "PLACES: Time to decay all frecencies values on idle (ms)")
-HISTOGRAM(PLACES_IDLE_MAINTENANCE_TIME_MS, 1000, 30000, 10, EXPONENTIAL, "PLACES: Time to execute maintenance tasks on idle (ms)")
-HISTOGRAM(PLACES_ANNOS_BOOKMARKS_COUNT, 50, 5000, 10, EXPONENTIAL, "PLACES: Number of bookmarks annotations")
-HISTOGRAM(PLACES_ANNOS_BOOKMARKS_SIZE_KB, 10, 10000, 10, EXPONENTIAL, "PLACES: Size of bookmarks annotations (KB)")
-HISTOGRAM(PLACES_ANNOS_PAGES_COUNT, 50, 5000, 10, EXPONENTIAL, "PLACES: Number of pages annotations")
-HISTOGRAM(PLACES_ANNOS_PAGES_SIZE_KB, 10, 10000, 10, EXPONENTIAL, "PLACES: Size of pages annotations (KB)")
-HISTOGRAM(PLACES_FRECENCY_CALC_TIME_MS, 1, 100, 10, EXPONENTIAL, "PLACES: Time to calculate frecency of a page (ms)")
-
-/**
- * Updater telemetry.
- */
-HISTOGRAM(UPDATER_STATUS_CODES, 1, 50, 51, LINEAR, "Updater: the status of the latest update performed")
-HISTOGRAM_BOOLEAN(UPDATER_UPDATES_ENABLED, "Updater: Whether or not updates are enabled")
-HISTOGRAM_BOOLEAN(UPDATER_UPDATES_AUTOMATIC, "Updater: Whether or not updates are automatic")
-HISTOGRAM_BOOLEAN(UPDATER_SERVICE_ENABLED, "Updater: Whether or not the MozillaMaintenance service is enabled")
-HISTOGRAM(UPDATER_SERVICE_ERRORS, 1, 30, 31, LINEAR, "Updater: The number of MozillaMaintenance service errors that have occurred")
-HISTOGRAM_BOOLEAN(UPDATER_SERVICE_INSTALLED, "Updater: Whether or not the MozillaMaintenance service is installed")
-HISTOGRAM_BOOLEAN(UPDATER_SERVICE_MANUALLY_UNINSTALLED, "Updater: Whether or not someone manually uninstalled the service.")
-HISTOGRAM_BOOLEAN(UPDATER_STAGE_ENABLED, "Updater: Whether or not staging updates are enabled")
-HISTOGRAM_BOOLEAN(UPDATER_HAS_PERMISSIONS, "Updater: Whether or not the updater has permissions")
-
-/**
- * Thunderbird-specific telemetry.
- */
-// Disable this application-specific #ifdef ftb. (See bug 710562)
-// #ifdef MOZ_THUNDERBIRD
-HISTOGRAM(THUNDERBIRD_GLODA_SIZE_MB, 1, 1000, 40, LINEAR, "Gloda: size of global-messages-db.sqlite (MB)")
-// THUNDERBIRD_CONVERSATIONS_TIME_TO_2ND_GLODA_QUERY_MS is used by Thunderbird Conversations add-on.
-// https://addons.mozilla.org/en-US/thunderbird/addon/54035/
-HISTOGRAM(THUNDERBIRD_CONVERSATIONS_TIME_TO_2ND_GLODA_QUERY_MS, 1, 10000, 30, EXPONENTIAL, "Conversations: time between the moment we click and the second gloda query returns (ms)")
-HISTOGRAM(THUNDERBIRD_INDEXING_RATE_MSG_PER_S, 1, 100, 20, LINEAR, "Gloda: indexing rate (message/s)")
-// #endif
-
-/**
- * Firefox-specific telemetry.
- */
-// Disable this application-specific #ifdef ftb. (See bug 710562)
-// #ifdef MOZ_PHOENIX
-HISTOGRAM(FX_TAB_ANIM_OPEN_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab opening animation in milliseconds")
-HISTOGRAM(FX_TAB_ANIM_CLOSE_MS, 1, 3000, 10, EXPONENTIAL, "Firefox: Time taken by the tab closing animation in milliseconds")
-HISTOGRAM_BOOLEAN(FX_KEYWORD_URL_USERSET, "Firefox: keyword.URL has a user-set value")
-HISTOGRAM(FX_IDENTITY_POPUP_OPEN_MS, 1, 1000, 10, EXPONENTIAL, "Firefox: Time taken by the identity popup to open in milliseconds")
-HISTOGRAM(FX_APP_MENU_OPEN_MS, 1, 1000, 10, EXPONENTIAL, "Firefox: Time taken by the app-menu opening in milliseconds")
-HISTOGRAM(FX_BOOKMARKS_TOOLBAR_INIT_MS, 50, 5000, 10, EXPONENTIAL, "Firefox: Time to initialize the bookmarks toolbar view (ms)")
-HISTOGRAM(FX_NEW_WINDOW_MS, 1, 10000, 20, EXPONENTIAL, "Firefox: Time taken to open a new browser window (ms)")
-
-/**
- * Thumbnail Service telemetry.
- */
-HISTOGRAM(FX_THUMBNAILS_CAPTURE_TIME_MS, 1, 500, 15, EXPONENTIAL, "THUMBNAILS: Time (ms) it takes to capture a thumbnail")
-HISTOGRAM(FX_THUMBNAILS_STORE_TIME_MS, 1, 500, 15, EXPONENTIAL, "THUMBNAILS: Time (ms) it takes to store a thumbnail in the cache")
-HISTOGRAM_BOOLEAN(FX_THUMBNAILS_HIT_OR_MISS, "THUMBNAILS: Thumbnail found")
-
-
-/*
- * Widget telemetry.
- */
-HISTOGRAM(EVENTLOOP_UI_LAG_EXP_MS, 50, 60000, 20, EXPONENTIAL, "Widget: Time it takes for the message before a UI message (ms)")
-
-/**
- * Session restore telemetry
- */
-HISTOGRAM(FX_SESSION_RESTORE_COLLECT_DATA_MS, 1, 30000, 10, EXPONENTIAL, "Session restore: Time to collect all window and tab data (ms)")
-HISTOGRAM(FX_SESSION_RESTORE_SERIALIZE_DATA_MS, 1, 1000, 10, EXPONENTIAL, "Session restore: Time to JSON serialize session data (ms)")
-HISTOGRAM(FX_SESSION_RESTORE_READ_FILE_MS, 1, 3000, 10, EXPONENTIAL, "Session restore: Time to read the session data from the file on disk (ms)")
-HISTOGRAM(FX_SESSION_RESTORE_WRITE_FILE_MS, 1, 3000, 10, EXPONENTIAL, "Session restore: Time to write the session data to the file on disk (ms)")
-HISTOGRAM_BOOLEAN(FX_SESSION_RESTORE_CORRUPT_FILE, "Session restore: Whether the file read on startup contained parse-able JSON")
-// #endif
-
-HISTOGRAM_BOOLEAN(INNERWINDOWS_WITH_MUTATION_LISTENERS, "Deleted or to-be-reused innerwindow which has had mutation event listeners.")
-HISTOGRAM(XUL_FOREGROUND_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "XUL reflows in foreground windows (ms)")
-HISTOGRAM(XUL_BACKGROUND_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "XUL reflows in background windows (ms)")
-HISTOGRAM(HTML_FOREGROUND_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "HTML reflows in foreground windows (ms)")
-HISTOGRAM(HTML_BACKGROUND_REFLOW_MS, 1, 3000, 10, EXPONENTIAL, "HTML reflows in background windows (ms)")
-HISTOGRAM(XUL_INITIAL_FRAME_CONSTRUCTION, 1, 3000, 10, EXPONENTIAL, "initial xul frame construction")
-HISTOGRAM_BOOLEAN(XMLHTTPREQUEST_ASYNC_OR_SYNC, "Type of XMLHttpRequest, async or sync")
-HISTOGRAM_BOOLEAN(MULTIPART_XHR_RESPONSE, "XMLHttpRequest response was of type multipart/x-mixed-replace.")
-
-/**
- * Private browsing transition telemetry.
- */
-HISTOGRAM(PRIVATE_BROWSING_TRANSITION_ENTER_PREPARATION_MS, 1, 3000, 10, EXPONENTIAL, "Time spent on private browsing enter transition, excluding session restore (ms)")
-HISTOGRAM(PRIVATE_BROWSING_TRANSITION_ENTER_TOTAL_MS, 1, 10000, 50, EXPONENTIAL, "Time spent on private browsing enter transition, including session restore (ms)")
-HISTOGRAM(PRIVATE_BROWSING_TRANSITION_EXIT_PREPARATION_MS, 1, 3000, 10, EXPONENTIAL, "Time spent on private browsing exit transition, excluding session restore (ms)")
-HISTOGRAM(PRIVATE_BROWSING_TRANSITION_EXIT_TOTAL_MS, 1, 10000, 50, EXPONENTIAL, "Time spent on private browsing exit transition, including session restore (ms)")
-
-/**
- * DOM telemetry.
- */
-HISTOGRAM(DOM_TIMERS_FIRED_PER_NATIVE_TIMEOUT, 1, 3000, 10, EXPONENTIAL, "DOM: Timer handlers called per native timer expiration")
-HISTOGRAM(DOM_TIMERS_RECENTLY_SET, 1, 3000, 10, EXPONENTIAL, "DOM: setTimeout/setInterval calls recently (last 30s or more)")
-HISTOGRAM_BOOLEAN(DOM_RANGE_DETACHED, "DOM: Ranges that are detached on destruction (bug 702948)")
-
-/**
- * DOM Storage telemetry.
- */
-#define DOMSTORAGE_HISTOGRAM(PREFIX, TYPE, TYPESTRING, DESCRIPTION) \
-  HISTOGRAM(PREFIX ## DOMSTORAGE_ ## TYPE ## _SIZE_BYTES, \
-            1024, 32768, 10, EXPONENTIAL, "DOM storage: size of " TYPESTRING "s stored in " DESCRIPTION "Storage")
-#define DOMSTORAGE_KEY_VAL_SIZE(PREFIX, DESCRIPTION) \
-  DOMSTORAGE_HISTOGRAM(PREFIX, KEY, "key", DESCRIPTION) \
-  DOMSTORAGE_HISTOGRAM(PREFIX, VALUE, "value", DESCRIPTION)
-
-DOMSTORAGE_KEY_VAL_SIZE(GLOBAL, "global")
-DOMSTORAGE_KEY_VAL_SIZE(LOCAL, "local")
-DOMSTORAGE_KEY_VAL_SIZE(SESSION, "session")
-
-#undef DOMSTORAGE_KEY_VAL_SIZE
-#undef DOMSTORAGE_HISTOGRAM
-
-/**
- * Telemetry telemetry.
- */
-HISTOGRAM(RANGE_CHECKSUM_ERRORS, 1, 3000, 10, EXPONENTIAL, "Number of histograms with range checksum errors")
-HISTOGRAM(BUCKET_ORDER_ERRORS, 1, 3000, 10, EXPONENTIAL, "Number of histograms with bucket order errors")
-HISTOGRAM(TOTAL_COUNT_HIGH_ERRORS, 1, 3000, 10, EXPONENTIAL, "Number of histograms with total count high errors")
-HISTOGRAM(TOTAL_COUNT_LOW_ERRORS, 1, 3000, 10, EXPONENTIAL, "Number of histograms with total count low errors")
-HISTOGRAM_FLAG(TELEMETRY_TEST_FLAG, "a testing histogram; not meant to be touched")
-
-/**
- * Startup Crash Detection
- */
-HISTOGRAM_FLAG(STARTUP_CRASH_DETECTED, "Whether there was a crash during the last startup")
-HISTOGRAM_ENUMERATED_VALUES(SAFE_MODE_USAGE, 3, "Whether the user is in safe mode (No, Yes, Forced)")
-
-/**
- * New Tab Page telemetry.
- */
-HISTOGRAM_BOOLEAN(NEWTAB_PAGE_ENABLED, "New tab page is enabled.")
-HISTOGRAM(NEWTAB_PAGE_PINNED_SITES_COUNT, 1, 9, 10, EXPONENTIAL, "Number of pinned sites on the new tab page.")
-HISTOGRAM(NEWTAB_PAGE_BLOCKED_SITES_COUNT, 1, 100, 10, EXPONENTIAL, "Number of sites blocked from the new tab page.")
-
-/**
- * Panorama telemetry.
- */
-HISTOGRAM(PANORAMA_INITIALIZATION_TIME_MS, 1, 10000, 15, EXPONENTIAL, "Time it takes to initialize Panorama (ms)")
-HISTOGRAM(PANORAMA_GROUPS_COUNT, 1, 25, 15, EXPONENTIAL, "Number of groups in Panorama")
-HISTOGRAM(PANORAMA_STACKED_GROUPS_COUNT, 1, 25, 15, EXPONENTIAL, "Number of stacked groups in Panorama")
-HISTOGRAM(PANORAMA_MEDIAN_TABS_IN_GROUPS_COUNT, 1, 100, 15, EXPONENTIAL, "Median of tabs in groups in Panorama")
-
-/**
- * Native Fennec Telemetry
- */
-#if defined(ANDROID)
-HISTOGRAM(BROWSERPROVIDER_XUL_IMPORT_TIME, 20, 600000, 20, EXPONENTIAL, "Time for the initial conversion of a XUL places database (ms)")
-HISTOGRAM(BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS, 1, 50000, 20, EXPONENTIAL, "Number of bookmarks in the original XUL places database")
-HISTOGRAM(BROWSERPROVIDER_XUL_IMPORT_HISTORY, 1, 1000000, 20, EXPONENTIAL, "Number of history entries in the original XUL places database")
-HISTOGRAM_FLAG(OUT_OF_MEMORY_KILLED, "Killed due to an OOM condition")
-#endif
-
-/**
- * Security UI Telemetry
- */
-HISTOGRAM_ENUMERATED_VALUES(SECURITY_UI, 100, "Security UI Telemetry")
-
-#undef HISTOGRAM_ENUMERATED_VALUES
-#undef HISTOGRAM_BOOLEAN
-#undef HISTOGRAM_FLAG
new file mode 100644
--- /dev/null
+++ b/toolkit/components/telemetry/gen-histogram-data.py
@@ -0,0 +1,144 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Write out histogram information for C++.  The histograms are defined
+# in a file provided as a command-line argument.
+
+from __future__ import with_statement
+
+import sys
+import histogram_tools
+
+banner = """/* This file is auto-generated, see gen-histogram-data.py.  */
+"""
+
+# Write out the gHistograms array.  Try and ensure the user didn't
+# provide bogus keys in the histogram definition.
+
+def check_keys(name, definition, allowed_keys):
+    for key in definition.iterkeys():
+        if key not in allowed_keys:
+            raise KeyError, '%s not permitted for %s' % (key, name)
+
+def print_array_entry(name, low, high, n_buckets, kind, definition):
+    cpp_guard = definition.get('cpp_guard')
+    if cpp_guard:
+        print "#if defined(%s)" % cpp_guard
+    print "  { \"%s\", %s, %s, %s, nsITelemetry::HISTOGRAM_%s, \"%s\" }," \
+        % (name, low, high, n_buckets, kind, definition['description'])
+    if cpp_guard:
+        print "#endif"
+
+def process_boolean(name, definition):
+    print_array_entry(name, 0, 1, 2, 'BOOLEAN', definition)
+
+def process_flag(name, definition):
+    print_array_entry(name, 0, 1, 2, 'FLAG', definition)
+
+def process_enumerated_values(name, definition):
+    n_values = definition['n_values']
+    print_array_entry(name, 1, n_values, "%s+1" % n_values, 'LINEAR',
+                      definition)
+
+def process_general_histogram(name, definition):
+    low = definition.get('low', 1)
+    high = definition['high']
+    n_buckets = definition['n_buckets']
+    print_array_entry(name, low, high, n_buckets,
+                      definition['kind'].upper(), definition)
+
+always_allowed_keys = ['kind', 'description', 'cpp_guard']
+
+def write_histogram_table(histograms):
+    general_keys = ['low', 'high', 'n_buckets'] + always_allowed_keys
+
+    table = {
+        'boolean' : (process_boolean, always_allowed_keys),
+        'flag' : (process_flag, always_allowed_keys),
+        'enumerated' : (process_enumerated_values, ['n_values'] + always_allowed_keys),
+        'linear' : (process_general_histogram, general_keys),
+        'exponential' : (process_general_histogram, general_keys),
+        }
+
+    print "const TelemetryHistogram gHistograms[] = {"
+    for (name, definition) in histograms:
+        kind = definition['kind']
+        if kind in table:
+            (processor, allowed_keys) = table[kind]
+            check_keys(name, definition, allowed_keys)
+            processor(name, definition)
+        else:
+            print "Don't know how to handle a histogram of kind ", kind
+            sys.exit(1)
+    print "};"
+
+# Write out static asserts for histogram data.  We'd prefer to perform
+# these checks in this script itself, but since several histograms
+# (generally enumerated histograms) use compile-time constants for
+# their upper bounds, we have to let the compiler do the checking.
+
+def static_assert(expression, message):
+    print "MOZ_STATIC_ASSERT(%s, \"%s\");" % (expression, message)
+
+def static_asserts_for_boolean(name, definition):
+    pass
+
+def static_asserts_for_flag(name, definition):
+    pass
+
+def static_asserts_for_enumerated(name, definition):
+    n_values = definition['n_values']
+    static_assert("%s > 2" % n_values, "Not enough values for %s" % name)
+
+def shared_static_asserts(name, definition):
+    low = definition.get('low', 1)
+    high = definition['high']
+    n_buckets = definition['n_buckets']
+    static_assert("%s < %s" % (low, high), "low >= high for %s" % name)
+    static_assert("%s > 2" % n_buckets, "Not enough values for %s" % name)
+    static_assert("%s >= 1" % low, "Incorrect low value for %s" % name)
+
+def static_asserts_for_linear(name, definition):
+    shared_static_asserts(name, definition)
+
+def static_asserts_for_exponential(name, definition):
+    shared_static_asserts(name, definition)
+
+def write_histogram_static_asserts(histograms):
+    print """
+// Perform the checks at the beginning of HistogramGet at
+// compile time, so that incorrect histogram definitions
+// give compile-time errors, not runtime errors."""
+
+    table = {
+        'boolean' : static_asserts_for_boolean,
+        'flag' : static_asserts_for_flag,
+        'enumerated' : static_asserts_for_enumerated,
+        'linear' : static_asserts_for_linear,
+        'exponential' : static_asserts_for_exponential,
+        }
+
+    for (name, definition) in histograms:
+        kind = definition['kind']
+        if kind in table:
+            cpp_guard = definition.get('cpp_guard')
+            if cpp_guard:
+                print "#if defined(%s)" % cpp_guard
+            table[kind](name, definition)
+            if cpp_guard:
+                print "#endif"
+        else:
+            print "Don't know how to handle a histogram of kind", kind
+            sys.exit(1)
+
+def main(argv):
+    filename = argv[0]
+
+    histograms = list(histogram_tools.from_file(filename))
+
+    print banner
+    write_histogram_table(histograms)
+    write_histogram_static_asserts(histograms)
+
+main(sys.argv[1:])
new file mode 100644
--- /dev/null
+++ b/toolkit/components/telemetry/gen-histogram-enum.py
@@ -0,0 +1,32 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Write out a C++ enum definition whose members are the names of
+# histograms.  The histograms are defined in a file provided as a
+# command-line argument.
+
+from __future__ import with_statement
+
+import sys
+import histogram_tools
+
+banner = """/* This file is auto-generated, see gen-histogram-enum.py.  */
+"""
+
+def main(argv):
+    filename = argv[0]
+
+    print banner
+    print "enum ID {"
+    for (name, definition) in histogram_tools.from_file(filename):
+        cpp_guard = definition.get('cpp_guard')
+        if cpp_guard:
+            print "#if defined(%s)" % cpp_guard
+        print "  %s," % (name,)
+        if cpp_guard:
+            print "#endif"
+    print "  HistogramCount"
+    print "};"
+
+main(sys.argv[1:])
new file mode 100644
--- /dev/null
+++ b/toolkit/components/telemetry/histogram_tools.py
@@ -0,0 +1,15 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+from __future__ import with_statement
+
+import simplejson as json
+
+def from_file(filename):
+    """Return an iterator that provides (name, definition) tuples of
+histograms defined in filename.
+    """
+    with open(filename, 'r') as f:
+        histograms = json.load(f, object_pairs_hook=json.OrderedDict)
+        return histograms.iteritems()