Performance/Telemetry: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
Telemetry allows developers to receive aggregate data of browser health in the field ([https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsITelemetry docs]).<br>
Telemetry allows developers to receive aggregate data of browser health in the field ([https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsITelemetry docs]).


The following statistics are currently gathered:
== Telemetry gotchas ==


<br>
= Aborts =
Telemetry uses chrome's UMA_* macros in histogram.h. These are presented via nsITelemetry to JS.
In debug mode histogram code will check the histogram name is always used with the same histogram type, minimum, maximum, bucket_count parameters. If these checks fail, then the program aborts. One needs to make sure that the same histogram is used consistently across the codebase. Typically histograms are only accessed from a single place in a codebase, so this isn't a problem.
 
= Threading =
Histograms should always be accessed from the same thread as they are created. Creating a new histogram (or obtaining an existing one) is protected by a lock. However accumulating data is not thread-safe.
 
= Data Gathered =


== about:memory stats  ==
== about:memory stats  ==

Revision as of 18:36, 23 May 2011

Telemetry allows developers to receive aggregate data of browser health in the field (docs).

Telemetry gotchas

Aborts

Telemetry uses chrome's UMA_* macros in histogram.h. These are presented via nsITelemetry to JS. In debug mode histogram code will check the histogram name is always used with the same histogram type, minimum, maximum, bucket_count parameters. If these checks fail, then the program aborts. One needs to make sure that the same histogram is used consistently across the codebase. Typically histograms are only accessed from a single place in a codebase, so this isn't a problem.

Threading

Histograms should always be accessed from the same thread as they are created. Creating a new histogram (or obtaining an existing one) is protected by a lock. However accumulating data is not thread-safe.

Data Gathered

about:memory stats

The following stats are periodically polled from about:memory:

  • Memory:heap-used/js/gc-heap (KB)
  • Memory:heap-used/layout/all (KB)
  • Memory:mapped/heap/used (KB)

Latency stats:

  • nsCycleCollector::Collect (ms) - Time spent on cycle collection

Telemetry self-diagnostics:

  • telemetry.ping (ms) - Delay between submitting telemetry ping data and getting a response from server.
  • telemetry.success (No, Yes) - Whether the past telemetry pings succeeded 1:No 2:Yes.