Performance/Telemetry

From MozillaWiki
< Performance
Revision as of 22:52, 14 June 2011 by Tglek (talk | contribs)
Jump to navigation Jump to search

Telemetry allows developers to receive aggregate data of browser health in the field. Note, currently Telemetry info is not gathered by the crash reporter.

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.

Note, bug 661574 will make this an even smaller problem since histogram parameters will no longer be defined on every callsite. Instead they will be defined together in a single header

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.

Timing Attacks

Probes must not appear in code paths that are sensitive to timing attacks on passwords/keys.

Addons

Addons must not add probes because we cannot evaluate them for privacy problems. Addons introduce a security liability of having Firefox send potentially private information to our servers.

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.