Personal tools

Performance/Telemetry

From MozillaWiki

Jump to: navigation, 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.

Contents

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.


Metrics Presentation

General Summary/Graphs

  • geo-io location info
  • locale
  • Firefox version
  • Operating system
  • device
  • ram
  • cpu

Histograms

Histograms are submitted as {name, range:[min,max], type, sum, values:{"0":x, ... n:y}}. They should be aggregated with name + histogram parameters forming a unique id.

Filtering

The ui should provide a filtering capability. For example we should be able to filter inputs going into histogram aggregations by the fields listed in "General Summary/Graphs". Furthermore it would be useful to filter by other histograms, ie "only include entries where histograms contain entires in the x-y range".

Trending

It would be nice to provide tracking of telemetry values and notify developers of changes in trends, "ie memory usage went up by 5-10mb in build x vs y".