Skip to content

Instantly share code, notes, and snippets.

@badboy
Created April 10, 2019 12:47
Show Gist options
  • Save badboy/5103d2011793c7f2c39ef11056a59dcf to your computer and use it in GitHub Desktop.
Save badboy/5103d2011793c7f2c39ef11056a59dcf to your computer and use it in GitHub Desktop.
// -*- mode: rust -*-
//
// AUTOGENERATED BY glean_parser. DO NOT EDIT.
//
// 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/.
#![allow(non_upper_case_globals)]
use lazy_static::lazy_static;
use maplit::hashmap;
use glean_core::CommonMetricData;
use glean_core::metrics::DatetimeMetric;
use glean_core::metrics::EnumerationMetric;
use glean_core::metrics::EventMetric;
use glean_core::metrics::StringMetric;
lazy_static! {
/// The application locale, e.g. “en-US”.
pub static ref locale: StringMetric = StringMetric::new(
CommonMetricData {
name: "locale".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// The name of the operating system.
pub static ref os: EnumerationMetric = EnumerationMetric::new(
CommonMetricData {
name: "os".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
values: vec![],
disabled: false,
}
);
/// The version of the operating system.
pub static ref os_version: StringMetric = StringMetric::new(
CommonMetricData {
name: "os_version".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// Build.MANUFACTURER + " - " + Build.MODEL, where manufacturer is truncated to 12
/// characters & model is truncated to 19 characters.
pub static ref device: StringMetric = StringMetric::new(
CommonMetricData {
name: "device".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// The architecture of the device.
pub static ref arch: EnumerationMetric = EnumerationMetric::new(
CommonMetricData {
name: "arch".into(),
category: "environment".into(),
send_in_pings: vec!["default".into(), ],
lifetime: Lifetime::Application,
values: vec![],
disabled: false,
}
);
/// Profile creation date.
pub static ref profile_date: DatetimeMetric = DatetimeMetric::new(
CommonMetricData {
name: "profile_date".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::User,
time_unit: TimeUnit::Day,
disabled: false,
}
);
/// Identifier of the default search engine, e.g. “yahoo”.
pub static ref default_search: StringMetric = StringMetric::new(
CommonMetricData {
name: "default_search".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// Version displayed to the user, e.g. “57.0b2”.
pub static ref display_version: StringMetric = StringMetric::new(
CommonMetricData {
name: "display_version".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// Distribution identifier, e.g. “lollipop”.
pub static ref distribution_id: StringMetric = StringMetric::new(
CommonMetricData {
name: "distribution_id".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// Adjust’s campaign identifier.
pub static ref campaign_id: StringMetric = StringMetric::new(
CommonMetricData {
name: "campaign_id".into(),
category: "environment".into(),
send_in_pings: vec!["core".into(), ],
lifetime: Lifetime::Application,
disabled: false,
}
);
/// Just testing events
pub static ref event_example: EventMetricType<eventExampleKeys> = EventMetricType<eventExampleKeys>::new(
CommonMetricData {
name: "event_example".into(),
category: "environment".into(),
send_in_pings: vec!["default".into(), ],
lifetime: Lifetime::Ping,
disabled: false,
}
);
/// Just testing events
pub static ref event_no_keys: EventMetricType<NoExtraKeys> = EventMetricType<NoExtraKeys>::new(
CommonMetricData {
name: "event_no_keys".into(),
category: "environment".into(),
send_in_pings: vec!["default".into(), ],
lifetime: Lifetime::Ping,
disabled: false,
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment