glean/glean-core
brizental 8d63a48c45 Update android sample app id in docs
[doc only]
2020-06-22 10:09:37 +02:00
..
android Update android sample app id in docs 2020-06-22 10:09:37 +02:00
benchmark 1557048: Add reason codes to the metrics ping (#649) 2020-02-11 20:40:10 +05:30
csharp Fix lint 2020-06-18 14:38:35 -05:00
examples 1557048: Add reason codes to the metrics ping (#649) 2020-02-11 20:40:10 +05:30
ffi Bumped version to 31.1.1 2020-06-12 12:34:33 +02:00
ios Limit the number of upload retries in Python and iOS (#968) 2020-06-10 11:54:09 +02:00
preview Bumped version to 31.1.1 2020-06-12 12:34:33 +02:00
python Bug 1646173: Python: Fix database not found on app shutdown (#983) 2020-06-17 14:39:03 -04:00
src Create metric to record upload failures (#967) 2020-06-10 11:48:10 +02:00
tests Create metric to record upload failures (#967) 2020-06-10 11:48:10 +02:00
Cargo.toml Bumped version to 31.1.1 2020-06-12 12:34:33 +02:00
LICENSE Prepare for crates.io releases 2019-11-04 15:54:15 +01:00
README.md 1557048: Add reason codes to the metrics ping (#649) 2020-02-11 20:40:10 +05:30
metrics.yaml Create metric to record upload failures (#967) 2020-06-10 11:48:10 +02:00
pings.yaml [doc only] Comment / doc improvements for foreground baseline pings (#823) 2020-04-14 10:44:13 -04:00

README.md

Glean SDK

The Glean SDK is a modern approach for a Telemetry library and is part of the Glean project.

glean-core

This library provides the core functionality of the Glean SDK, including implementations of all metric types, the ping serializer and the storage layer. It's used in all platform-specific wrappers.

It's not intended to be used by users directly. Each supported platform has a specific Glean package with a nicer API. A nice Rust API will be provided by the Glean crate.

Documentation

All documentation is available online:

Usage

use glean_core::{Glean, Configuration, CommonMetricData, metrics::*};
let cfg = Configuration {
    data_path: "/tmp/glean".into(),
    application_id: "glean.sample.app".into(),
    upload_enabled: true,
    max_events: None,
};
let mut glean = Glean::new(cfg).unwrap();
let ping = PingType::new("sample", true, true, vec![]);
glean.register_ping_type(&ping);

let call_counter: CounterMetric = CounterMetric::new(CommonMetricData {
    name: "calls".into(),
    category: "local".into(),
    send_in_pings: vec!["sample".into()],
    ..Default::default()
});

call_counter.add(&glean, 1);

glean.submit_ping(&ping, None).unwrap();

License

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/