telemetry/
lib.rs

1//! Telemetry is a mechanism used to capture metrics in an application,
2//! to later store the data locally or upload it to a server for
3//! statistical analysis.
4//!
5//!
6//! Examples of usage:
7//!
8//! - capturing the speed of an operation;
9//! - finding out if a remote service is often down, and how much impact this has on users;
10//! - finding out if users are actually using a feature;
11//! - finding out how the duration of a session;
12//! - determine the operating system on which the application is executed;
13//! - determining the configuration of the application;
14//! - capturing the operations that slow down the application;
15//! - determining the amount of I/O performed by the application;
16//! - ...
17//!
18//!
19//! This crate provides an API for recording such data in _Histograms_
20//! and then serializing the data. Uploading the data or storing th
21//! data is out of the scope of this crate.
22//!
23//!
24//!
25//! Memory note: the memory used by a histogram is recollected only
26//! when its instance of `telemetry::Service` is garbage-collected. In other
27//! words, if a histogram goes out of scope for some reason, its data
28//! remains in telemetry and will be stored and/or uploaded in
29//! accordance with the configuration of this telemetry instance.
30//!
31//! See [Mozilla Telemetry
32//! Server](https://github.com/mozilla/telemetry-server) for an
33//! open-source implementation of a server implementing the Telemetry
34//! protocol.
35
36extern crate rustc_serialize;
37
38mod misc;
39
40/// Data that may be converted to numbers for storage in a histogram.
41pub use misc::Flatten;
42
43/// A serialization format, as a subset of Json.
44pub use misc::SerializationFormat;
45
46/// A subset of data to export.
47pub use misc::Subset;
48
49mod indexing;
50
51mod task;
52
53/// Definition of plain histograms, for data in a set known at compile-time.
54pub mod plain;
55
56/// Plain histograms.
57pub use plain::Histogram;
58
59/// Definition of keyed histograms, for data in a set known dynamically.
60pub mod keyed;
61
62/// Keyed histograms.
63pub use keyed::KeyedHistogram;
64
65mod service;
66
67/// The Telemetry Service. You need one (or more) per application.
68pub use service::Service;