glean/glean-core
Beatriz Rizental dafca57531
Implement ping tagging for iOS (#1100)
2020-07-28 14:34:49 +02:00
..
android Log as errors 2020-07-22 11:06:40 +02:00
benchmark Bug 1646626 - Add User-Agent headers to ping requests (#1030) 2020-07-03 15:25:02 +02:00
csharp Enable the c# Labeled Counter and add its documentation 2020-07-28 11:53:24 +02:00
examples Bug 1646626 - Add User-Agent headers to ping requests (#1030) 2020-07-03 15:25:02 +02:00
ffi Bumped version to 31.6.0 2020-07-24 13:42:02 -05:00
ios Implement ping tagging for iOS (#1100) 2020-07-28 14:34:49 +02:00
preview Bumped version to 31.6.0 2020-07-24 13:42:02 -05:00
python Update glean_parser to 1.28.1 2020-07-24 07:22:02 -05:00
src Bug 1650781: Use overflow rather than invalid for long strings (#1079) 2020-07-21 16:43:19 -04:00
tests Bug 1650781: Use overflow rather than invalid for long strings (#1079) 2020-07-21 16:43:19 -04:00
Cargo.toml Bumped version to 31.6.0 2020-07-24 13:42:02 -05: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 Fix YAML formatting 2020-07-27 18:38:27 -04:00
pings.yaml Fix YAML formatting 2020-07-27 18:38:27 -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/