Move channel to client info metrics, not main configuration

This commit is contained in:
Jan-Erik Rediger 2022-01-25 11:15:43 +01:00 коммит произвёл Jan-Erik Rediger
Родитель 86e89e936b
Коммит b2c5c0c34f
14 изменённых файлов: 6 добавлений и 32 удалений

Просмотреть файл

@ -49,7 +49,6 @@ fn main() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: None,
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: true,
@ -58,6 +57,7 @@ fn main() {
let client_info = ClientInfoMetrics {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: None,
};
glean::register_ping_type(&PrototypePing);

Просмотреть файл

@ -46,7 +46,6 @@ pub(crate) fn new_glean(
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,

Просмотреть файл

@ -24,8 +24,6 @@ pub struct Configuration {
pub max_events: Option<usize>,
/// Whether Glean should delay persistence of data from metrics with ping lifetime.
pub delay_ping_lifetime_io: bool,
/// The release channel the application is on, if known.
pub channel: Option<String>,
/// The server pings are sent to.
pub server_endpoint: Option<String>,
/// The instance of the uploader used to send pings.

Просмотреть файл

@ -14,6 +14,8 @@ pub struct ClientInfoMetrics {
pub app_build: String,
/// The user visible version string (e.g. "1.0.3").
pub app_display_version: String,
/// The product-provided release channel (e.g. "beta").
pub channel: Option<String>,
}
impl ClientInfoMetrics {
@ -22,6 +24,7 @@ impl ClientInfoMetrics {
ClientInfoMetrics {
app_build: "Unknown".to_string(),
app_display_version: "Unknown".to_string(),
channel: None,
}
}
}

Просмотреть файл

@ -25,7 +25,6 @@
//! upload_enabled: true,
//! max_events: None,
//! delay_ping_lifetime_io: false,
//! channel: None,
//! server_endpoint: None,
//! uploader: None,
//! use_core_mps: false,

Просмотреть файл

@ -42,7 +42,6 @@ fn send_a_ping() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -153,7 +152,6 @@ fn test_experiments_recording_before_glean_inits() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -214,7 +212,6 @@ fn sending_of_foreground_background_pings() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -299,7 +296,6 @@ fn sending_of_startup_baseline_ping() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -360,7 +356,6 @@ fn no_dirty_baseline_on_clean_shutdowns() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -392,7 +387,6 @@ fn initialize_must_not_crash_if_data_dir_is_messed_up() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -451,7 +445,6 @@ fn initializing_twice_is_a_noop() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -471,7 +464,6 @@ fn initializing_twice_is_a_noop() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -508,7 +500,6 @@ fn the_app_channel_must_be_correctly_set_if_requested() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: None,
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -623,7 +614,6 @@ fn sending_deletion_ping_if_disabled_outside_of_run() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -642,7 +632,6 @@ fn sending_deletion_ping_if_disabled_outside_of_run() {
upload_enabled: false,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -690,7 +679,6 @@ fn no_sending_of_deletion_ping_if_unchanged_outside_of_run() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -709,7 +697,6 @@ fn no_sending_of_deletion_ping_if_unchanged_outside_of_run() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -775,7 +762,6 @@ fn setting_debug_view_tag_before_initialization_should_not_crash() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -835,7 +821,6 @@ fn setting_source_tags_before_initialization_should_not_crash() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -896,7 +881,6 @@ fn setting_source_tags_after_initialization_should_not_crash() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -969,7 +953,6 @@ fn flipping_upload_enabled_respects_order_of_events() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -1040,7 +1023,6 @@ fn registering_pings_before_init_must_work() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,
@ -1091,7 +1073,6 @@ fn test_a_ping_before_submission() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(FakeUploader { sender: s })),
use_core_mps: false,

Просмотреть файл

@ -44,6 +44,7 @@ pub fn initialize(cfg: Configuration) {
let client_info = ClientInfoMetrics {
app_build: "1.0.0".to_string(),
app_display_version: "1.0.0".to_string(),
channel: Some("testing".to_string()),
};
glean::initialize(cfg, client_info);

Просмотреть файл

@ -65,7 +65,6 @@ fn init_fails() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,

Просмотреть файл

@ -63,7 +63,6 @@ fn init_fails() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,

Просмотреть файл

@ -68,7 +68,6 @@ fn overflowing_the_task_queue_records_telemetry() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,

Просмотреть файл

@ -40,7 +40,6 @@ fn cfg_new(tmpname: PathBuf) -> Configuration {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: true,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,

Просмотреть файл

@ -20,7 +20,6 @@ fn cfg_new(tmpname: PathBuf) -> Configuration {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: true,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,

Просмотреть файл

@ -33,7 +33,6 @@ fn new_glean(configuration: Option<Configuration>) -> tempfile::TempDir {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,
@ -43,6 +42,7 @@ fn new_glean(configuration: Option<Configuration>) -> tempfile::TempDir {
let client_info = ClientInfoMetrics {
app_build: env!("CARGO_PKG_VERSION").to_string(),
app_display_version: env!("CARGO_PKG_VERSION").to_string(),
channel: Some("testing".to_string()),
};
glean::initialize(cfg, client_info);
@ -84,7 +84,6 @@ fn validate_against_schema() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: Some(Box::new(ValidatingUploader { sender: s })),
use_core_mps: false,

Просмотреть файл

@ -65,7 +65,6 @@ fn simple_lifecycle() {
upload_enabled: true,
max_events: None,
delay_ping_lifetime_io: false,
channel: Some("testing".into()),
server_endpoint: Some("invalid-test-host".into()),
uploader: None,
use_core_mps: false,