forked from mirrors/gecko-dev
Bug 1827399 - Update Glean to v52.5.0 r=janerik,supply-chain-reviewers
Depends on D174979 Differential Revision: https://phabricator.services.mozilla.com/D175174
This commit is contained in:
parent
38f4688935
commit
c2a5c87b71
27 changed files with 157 additions and 96 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
|
@ -2192,9 +2192,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glean"
|
name = "glean"
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e1bd184ec51a21129cb58a1b7380250d5f71de01b3461ab3b81594e0a2322123"
|
checksum = "cd952afea9a760de2fc9f5d15f204f0ffa42178f8b77787d3b282c0b3dd1f398"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
|
|
@ -2212,9 +2212,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glean-core"
|
name = "glean-core"
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0e543be303977a73d720ce612a49937d5ba3fac9907d2e13556a32c67293d5e"
|
checksum = "fe01fda83e8387e82f9b37f727870b9075e1e0dc9f7d061b40c76735ad238a22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_logger",
|
"android_logger",
|
||||||
"bincode",
|
"bincode",
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ allprojects {
|
||||||
topsrcdir = gradle.mozconfig.topsrcdir
|
topsrcdir = gradle.mozconfig.topsrcdir
|
||||||
topobjdir = gradle.mozconfig.topobjdir
|
topobjdir = gradle.mozconfig.topobjdir
|
||||||
|
|
||||||
gleanVersion = "52.4.2"
|
gleanVersion = "52.5.0"
|
||||||
if (gleanVersion != getRustVersionFor("glean")) {
|
if (gleanVersion != getRustVersionFor("glean")) {
|
||||||
throw new StopExecutionException("Mismatched Glean version, expected: ${gleanVersion}," +
|
throw new StopExecutionException("Mismatched Glean version, expected: ${gleanVersion}," +
|
||||||
" found ${getRustVersionFor("glean")}")
|
" found ${getRustVersionFor("glean")}")
|
||||||
|
|
|
||||||
8
gfx/wr/Cargo.lock
generated
8
gfx/wr/Cargo.lock
generated
|
|
@ -940,9 +940,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glean"
|
name = "glean"
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e1bd184ec51a21129cb58a1b7380250d5f71de01b3461ab3b81594e0a2322123"
|
checksum = "cd952afea9a760de2fc9f5d15f204f0ffa42178f8b77787d3b282c0b3dd1f398"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
|
|
@ -960,9 +960,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glean-core"
|
name = "glean-core"
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e0e543be303977a73d720ce612a49937d5ba3fac9907d2e13556a32c67293d5e"
|
checksum = "fe01fda83e8387e82f9b37f727870b9075e1e0dc9f7d061b40c76735ad238a22"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_logger",
|
"android_logger",
|
||||||
"bincode",
|
"bincode",
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ svg_fmt = "0.4"
|
||||||
tracy-rs = "0.1.2"
|
tracy-rs = "0.1.2"
|
||||||
derive_more = { version = "0.99", default-features = false, features = ["add_assign"] }
|
derive_more = { version = "0.99", default-features = false, features = ["add_assign"] }
|
||||||
etagere = "0.2.6"
|
etagere = "0.2.6"
|
||||||
glean = "52.4.2"
|
glean = "52.5.0"
|
||||||
firefox-on-glean = { version = "0.1.0", optional = true }
|
firefox-on-glean = { version = "0.1.0", optional = true }
|
||||||
swgl = { path = "../swgl", optional = true }
|
swgl = { path = "../swgl", optional = true }
|
||||||
topological-sort = "0.1"
|
topological-sort = "0.1"
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ tracy-rs = "0.1.2"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
glean = { version = "52.4.2", optional = true }
|
glean = { version = "52.5.0", optional = true }
|
||||||
firefox-on-glean = { version = "0.1.0", optional = true }
|
firefox-on-glean = { version = "0.1.0", optional = true }
|
||||||
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
|
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ pth:xpcom/geckoprocesstypes_generator
|
||||||
pth:xpcom/idl-parser
|
pth:xpcom/idl-parser
|
||||||
# glean-sdk may not be installable if a wheel isn't available
|
# glean-sdk may not be installable if a wheel isn't available
|
||||||
# and it has to be built from source.
|
# and it has to be built from source.
|
||||||
pypi-optional:glean-sdk==52.4.2:telemetry will not be collected
|
pypi-optional:glean-sdk==52.5.0:telemetry will not be collected
|
||||||
# Mach gracefully handles the case where `psutil` is unavailable.
|
# Mach gracefully handles the case where `psutil` is unavailable.
|
||||||
# We aren't (yet) able to pin packages in automation, so we have to
|
# We aren't (yet) able to pin packages in automation, so we have to
|
||||||
# support down to the oldest locally-installed version (5.4.2).
|
# support down to the oldest locally-installed version (5.4.2).
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,15 @@ user-login = "martinthomson"
|
||||||
user-name = "Martin Thomson"
|
user-name = "Martin Thomson"
|
||||||
|
|
||||||
[[publisher.glean]]
|
[[publisher.glean]]
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
when = "2023-03-15"
|
when = "2023-04-11"
|
||||||
user-id = 48
|
user-id = 48
|
||||||
user-login = "badboy"
|
user-login = "badboy"
|
||||||
user-name = "Jan-Erik Rediger"
|
user-name = "Jan-Erik Rediger"
|
||||||
|
|
||||||
[[publisher.glean-core]]
|
[[publisher.glean-core]]
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
when = "2023-03-15"
|
when = "2023-04-11"
|
||||||
user-id = 48
|
user-id = 48
|
||||||
user-login = "badboy"
|
user-login = "badboy"
|
||||||
user-name = "Jan-Erik Rediger"
|
user-name = "Jan-Erik Rediger"
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
2
third_party/rust/glean-core/Cargo.toml
vendored
2
third_party/rust/glean-core/Cargo.toml
vendored
|
|
@ -13,7 +13,7 @@
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.62"
|
rust-version = "1.62"
|
||||||
name = "glean-core"
|
name = "glean-core"
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jan-Erik Rediger <jrediger@mozilla.com>",
|
"Jan-Erik Rediger <jrediger@mozilla.com>",
|
||||||
"The Glean Team <glean-team@mozilla.com>",
|
"The Glean Team <glean-team@mozilla.com>",
|
||||||
|
|
|
||||||
17
third_party/rust/glean-core/src/core/mod.rs
vendored
17
third_party/rust/glean-core/src/core/mod.rs
vendored
|
|
@ -12,7 +12,7 @@ use crate::event_database::EventDatabase;
|
||||||
use crate::internal_metrics::{AdditionalMetrics, CoreMetrics, DatabaseMetrics};
|
use crate::internal_metrics::{AdditionalMetrics, CoreMetrics, DatabaseMetrics};
|
||||||
use crate::internal_pings::InternalPings;
|
use crate::internal_pings::InternalPings;
|
||||||
use crate::metrics::{
|
use crate::metrics::{
|
||||||
self, ExperimentMetric, Metric, MetricType, MetricsDisabledConfig, PingType, RecordedExperiment,
|
self, ExperimentMetric, Metric, MetricType, MetricsEnabledConfig, PingType, RecordedExperiment,
|
||||||
};
|
};
|
||||||
use crate::ping::PingMaker;
|
use crate::ping::PingMaker;
|
||||||
use crate::storage::{StorageManager, INTERNAL_STORAGE};
|
use crate::storage::{StorageManager, INTERNAL_STORAGE};
|
||||||
|
|
@ -153,7 +153,7 @@ pub struct Glean {
|
||||||
pub(crate) app_build: String,
|
pub(crate) app_build: String,
|
||||||
pub(crate) schedule_metrics_pings: bool,
|
pub(crate) schedule_metrics_pings: bool,
|
||||||
pub(crate) remote_settings_epoch: AtomicU8,
|
pub(crate) remote_settings_epoch: AtomicU8,
|
||||||
pub(crate) remote_settings_metrics_config: Arc<Mutex<MetricsDisabledConfig>>,
|
pub(crate) remote_settings_metrics_config: Arc<Mutex<MetricsEnabledConfig>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Glean {
|
impl Glean {
|
||||||
|
|
@ -207,7 +207,7 @@ impl Glean {
|
||||||
// Subprocess doesn't use "metrics" pings so has no need for a scheduler.
|
// Subprocess doesn't use "metrics" pings so has no need for a scheduler.
|
||||||
schedule_metrics_pings: false,
|
schedule_metrics_pings: false,
|
||||||
remote_settings_epoch: AtomicU8::new(0),
|
remote_settings_epoch: AtomicU8::new(0),
|
||||||
remote_settings_metrics_config: Arc::new(Mutex::new(MetricsDisabledConfig::new())),
|
remote_settings_metrics_config: Arc::new(Mutex::new(MetricsEnabledConfig::new())),
|
||||||
};
|
};
|
||||||
|
|
||||||
// Ensuring these pings are registered.
|
// Ensuring these pings are registered.
|
||||||
|
|
@ -527,6 +527,7 @@ impl Glean {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets a handle to the database.
|
/// Gets a handle to the database.
|
||||||
|
#[track_caller] // If this fails we're interested in the caller.
|
||||||
pub fn storage(&self) -> &Database {
|
pub fn storage(&self) -> &Database {
|
||||||
self.data_store.as_ref().expect("No database found")
|
self.data_store.as_ref().expect("No database found")
|
||||||
}
|
}
|
||||||
|
|
@ -702,14 +703,14 @@ impl Glean {
|
||||||
metric.test_get_value(self)
|
metric.test_get_value(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set configuration for metrics' disabled property, typically from a remote_settings experiment
|
/// Set configuration to override the default metric enabled/disabled state, typically from a
|
||||||
/// or rollout
|
/// remote_settings experiment or rollout
|
||||||
///
|
///
|
||||||
/// # Arguments
|
/// # Arguments
|
||||||
///
|
///
|
||||||
/// * `json` - The stringified JSON representation of a `MetricsDisabledConfig` object
|
/// * `json` - The stringified JSON representation of a `MetricsEnabledConfig` object
|
||||||
pub fn set_metrics_disabled_config(&self, cfg: MetricsDisabledConfig) {
|
pub fn set_metrics_enabled_config(&self, cfg: MetricsEnabledConfig) {
|
||||||
// Set the current MetricsDisabledConfig, keeping the lock until the epoch is
|
// Set the current MetricsEnabledConfig, keeping the lock until the epoch is
|
||||||
// updated to prevent against reading a "new" config but an "old" epoch
|
// updated to prevent against reading a "new" config but an "old" epoch
|
||||||
let mut lock = self.remote_settings_metrics_config.lock().unwrap();
|
let mut lock = self.remote_settings_metrics_config.lock().unwrap();
|
||||||
*lock = cfg;
|
*lock = cfg;
|
||||||
|
|
|
||||||
15
third_party/rust/glean-core/src/database/mod.rs
vendored
15
third_party/rust/glean-core/src/database/mod.rs
vendored
|
|
@ -52,15 +52,12 @@ pub fn rkv_new(path: &Path) -> std::result::Result<Rkv, rkv::StoreError> {
|
||||||
// Now try again, we only handle that error once.
|
// Now try again, we only handle that error once.
|
||||||
Rkv::new::<rkv::backend::SafeMode>(path)
|
Rkv::new::<rkv::backend::SafeMode>(path)
|
||||||
}
|
}
|
||||||
// This code is currently disabled but intended to be turned on in the
|
Err(rkv::StoreError::DatabaseCorrupted) => {
|
||||||
// near future. Please reference this bug for more details:
|
let safebin = path.join("data.safe.bin");
|
||||||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1820792#c2
|
fs::remove_file(safebin).map_err(|_| rkv::StoreError::DatabaseCorrupted)?;
|
||||||
// Err(rkv::StoreError::DatabaseCorrupted) => {
|
// Try again, only allowing the error once.
|
||||||
// let safebin = path.join("data.safe.bin");
|
Rkv::new::<rkv::backend::SafeMode>(path)
|
||||||
// fs::remove_file(safebin).map_err(|_| rkv::StoreError::DatabaseCorrupted)?;
|
}
|
||||||
// // Try again, only allowing the error once.
|
|
||||||
// Rkv::new::<rkv::backend::SafeMode>(path)
|
|
||||||
// }
|
|
||||||
other => other,
|
other => other,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -258,16 +258,21 @@ impl EventDatabase {
|
||||||
/// monotonically increasing timer (this value is obtained on the
|
/// monotonically increasing timer (this value is obtained on the
|
||||||
/// platform-specific side).
|
/// platform-specific side).
|
||||||
/// * `extra` - Extra data values, mapping strings to strings.
|
/// * `extra` - Extra data values, mapping strings to strings.
|
||||||
|
///
|
||||||
|
/// ## Returns
|
||||||
|
///
|
||||||
|
/// `true` if a ping was submitted and should be uploaded.
|
||||||
|
/// `false` otherwise.
|
||||||
pub fn record(
|
pub fn record(
|
||||||
&self,
|
&self,
|
||||||
glean: &Glean,
|
glean: &Glean,
|
||||||
meta: &CommonMetricDataInternal,
|
meta: &CommonMetricDataInternal,
|
||||||
timestamp: u64,
|
timestamp: u64,
|
||||||
extra: Option<HashMap<String, String>>,
|
extra: Option<HashMap<String, String>>,
|
||||||
) {
|
) -> bool {
|
||||||
// If upload is disabled we don't want to record.
|
// If upload is disabled we don't want to record.
|
||||||
if !glean.is_upload_enabled() {
|
if !glean.is_upload_enabled() {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut submit_max_capacity_event_ping = false;
|
let mut submit_max_capacity_event_ping = false;
|
||||||
|
|
@ -303,6 +308,9 @@ impl EventDatabase {
|
||||||
}
|
}
|
||||||
if submit_max_capacity_event_ping {
|
if submit_max_capacity_event_ping {
|
||||||
glean.submit_ping_by_name("events", Some("max_capacity"));
|
glean.submit_ping_by_name("events", Some("max_capacity"));
|
||||||
|
true
|
||||||
|
} else {
|
||||||
|
false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
3
third_party/rust/glean-core/src/glean.udl
vendored
3
third_party/rust/glean-core/src/glean.udl
vendored
|
|
@ -29,6 +29,9 @@ namespace glean {
|
||||||
void glean_set_experiment_inactive(string experiment_id);
|
void glean_set_experiment_inactive(string experiment_id);
|
||||||
RecordedExperiment? glean_test_get_experiment_data(string experiment_id);
|
RecordedExperiment? glean_test_get_experiment_data(string experiment_id);
|
||||||
|
|
||||||
|
// Server Knobs API
|
||||||
|
void glean_set_metrics_enabled_config(string json);
|
||||||
|
|
||||||
boolean glean_set_debug_view_tag(string tag);
|
boolean glean_set_debug_view_tag(string tag);
|
||||||
boolean glean_set_source_tags(sequence<string> tags);
|
boolean glean_set_source_tags(sequence<string> tags);
|
||||||
void glean_set_log_pings(boolean value);
|
void glean_set_log_pings(boolean value);
|
||||||
|
|
|
||||||
14
third_party/rust/glean-core/src/lib.rs
vendored
14
third_party/rust/glean-core/src/lib.rs
vendored
|
|
@ -28,7 +28,7 @@ use crossbeam_channel::unbounded;
|
||||||
use once_cell::sync::{Lazy, OnceCell};
|
use once_cell::sync::{Lazy, OnceCell};
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use metrics::MetricsDisabledConfig;
|
use metrics::MetricsEnabledConfig;
|
||||||
|
|
||||||
mod common_metric_data;
|
mod common_metric_data;
|
||||||
mod core;
|
mod core;
|
||||||
|
|
@ -170,6 +170,7 @@ static STATE: OnceCell<Mutex<State>> = OnceCell::new();
|
||||||
/// Get a reference to the global state object.
|
/// Get a reference to the global state object.
|
||||||
///
|
///
|
||||||
/// Panics if no global state object was set.
|
/// Panics if no global state object was set.
|
||||||
|
#[track_caller] // If this fails we're interested in the caller.
|
||||||
fn global_state() -> &'static Mutex<State> {
|
fn global_state() -> &'static Mutex<State> {
|
||||||
STATE.get().unwrap()
|
STATE.get().unwrap()
|
||||||
}
|
}
|
||||||
|
|
@ -772,13 +773,14 @@ pub fn glean_test_get_experiment_data(experiment_id: String) -> Option<RecordedE
|
||||||
core::with_glean(|glean| glean.test_get_experiment_data(experiment_id.to_owned()))
|
core::with_glean(|glean| glean.test_get_experiment_data(experiment_id.to_owned()))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Sets a remote configuration for the metrics' disabled property
|
/// Sets a remote configuration to override metrics' default enabled/disabled
|
||||||
|
/// state
|
||||||
///
|
///
|
||||||
/// See [`core::Glean::set_metrics_disabled_config`].
|
/// See [`core::Glean::set_metrics_enabled_config`].
|
||||||
pub fn glean_set_metrics_disabled_config(json: String) {
|
pub fn glean_set_metrics_enabled_config(json: String) {
|
||||||
match MetricsDisabledConfig::try_from(json) {
|
match MetricsEnabledConfig::try_from(json) {
|
||||||
Ok(cfg) => launch_with_glean(|glean| {
|
Ok(cfg) => launch_with_glean(|glean| {
|
||||||
glean.set_metrics_disabled_config(cfg);
|
glean.set_metrics_enabled_config(cfg);
|
||||||
}),
|
}),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::error!("Error setting metrics feature config: {:?}", e);
|
log::error!("Error setting metrics feature config: {:?}", e);
|
||||||
|
|
|
||||||
|
|
@ -852,15 +852,15 @@ fn test_set_metrics_disabled() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// 2. Set a configuration to disable the metrics
|
// 2. Set a configuration to disable the metrics
|
||||||
let mut metrics_disabled_config = json!(
|
let mut metrics_enabled_config = json!(
|
||||||
{
|
{
|
||||||
"category.string_metric": true,
|
"category.string_metric": false,
|
||||||
"category.labeled_string_metric": true,
|
"category.labeled_string_metric": false,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.to_string();
|
.to_string();
|
||||||
glean.set_metrics_disabled_config(
|
glean.set_metrics_enabled_config(
|
||||||
MetricsDisabledConfig::try_from(metrics_disabled_config).unwrap(),
|
MetricsEnabledConfig::try_from(metrics_enabled_config).unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// 3. Since the metrics were disabled, setting a new value will be ignored
|
// 3. Since the metrics were disabled, setting a new value will be ignored
|
||||||
|
|
@ -883,9 +883,9 @@ fn test_set_metrics_disabled() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// 4. Set a new configuration where the metrics are enabled
|
// 4. Set a new configuration where the metrics are enabled
|
||||||
metrics_disabled_config = json!({}).to_string();
|
metrics_enabled_config = json!({}).to_string();
|
||||||
glean.set_metrics_disabled_config(
|
glean.set_metrics_enabled_config(
|
||||||
MetricsDisabledConfig::try_from(metrics_disabled_config).unwrap(),
|
MetricsEnabledConfig::try_from(metrics_enabled_config).unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// 5. Since the metrics are now enabled, setting a new value should work
|
// 5. Since the metrics are now enabled, setting a new value should work
|
||||||
|
|
@ -917,14 +917,14 @@ fn test_remote_settings_epoch() {
|
||||||
assert_eq!(0u8, current_epoch, "Current epoch must start at 0");
|
assert_eq!(0u8, current_epoch, "Current epoch must start at 0");
|
||||||
|
|
||||||
// 2. Set a configuration which will trigger incrementing the epoch
|
// 2. Set a configuration which will trigger incrementing the epoch
|
||||||
let metrics_disabled_config = json!(
|
let metrics_enabled_config = json!(
|
||||||
{
|
{
|
||||||
"category.string_metric": true
|
"category.string_metric": false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.to_string();
|
.to_string();
|
||||||
glean.set_metrics_disabled_config(
|
glean.set_metrics_enabled_config(
|
||||||
MetricsDisabledConfig::try_from(metrics_disabled_config).unwrap(),
|
MetricsEnabledConfig::try_from(metrics_enabled_config).unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// 3. Ensure the epoch updated
|
// 3. Ensure the epoch updated
|
||||||
|
|
@ -951,14 +951,14 @@ fn test_remote_settings_epoch_updates_in_metric() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// 2. Set a configuration to disable the `category.string_metric`
|
// 2. Set a configuration to disable the `category.string_metric`
|
||||||
let metrics_disabled_config = json!(
|
let metrics_enabled_config = json!(
|
||||||
{
|
{
|
||||||
"category.string_metric": true
|
"category.string_metric": false
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.to_string();
|
.to_string();
|
||||||
glean.set_metrics_disabled_config(
|
glean.set_metrics_enabled_config(
|
||||||
MetricsDisabledConfig::try_from(metrics_disabled_config).unwrap(),
|
MetricsEnabledConfig::try_from(metrics_enabled_config).unwrap(),
|
||||||
);
|
);
|
||||||
|
|
||||||
// 3. Ensure the epoch was updated
|
// 3. Ensure the epoch was updated
|
||||||
|
|
|
||||||
28
third_party/rust/glean-core/src/metrics/event.rs
vendored
28
third_party/rust/glean-core/src/metrics/event.rs
vendored
|
|
@ -68,7 +68,15 @@ impl EventMetric {
|
||||||
/// If any key is not allowed, an error is reported and no event is recorded.
|
/// If any key is not allowed, an error is reported and no event is recorded.
|
||||||
pub fn record_with_time(&self, timestamp: u64, extra: HashMap<String, String>) {
|
pub fn record_with_time(&self, timestamp: u64, extra: HashMap<String, String>) {
|
||||||
let metric = self.clone();
|
let metric = self.clone();
|
||||||
crate::launch_with_glean(move |glean| metric.record_sync(glean, timestamp, extra));
|
crate::launch_with_glean(move |glean| {
|
||||||
|
let sent = metric.record_sync(glean, timestamp, extra);
|
||||||
|
if sent {
|
||||||
|
let state = crate::global_state().lock().unwrap();
|
||||||
|
if let Err(e) = state.callbacks.trigger_upload() {
|
||||||
|
log::error!("Triggering upload failed. Error: {}", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Validate that extras are empty or all extra keys are allowed.
|
/// Validate that extras are empty or all extra keys are allowed.
|
||||||
|
|
@ -104,20 +112,30 @@ impl EventMetric {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Records an event.
|
/// Records an event.
|
||||||
|
///
|
||||||
|
/// ## Returns
|
||||||
|
///
|
||||||
|
/// `true` if a ping was submitted and should be uploaded.
|
||||||
|
/// `false` otherwise.
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn record_sync(&self, glean: &Glean, timestamp: u64, extra: HashMap<String, String>) {
|
pub fn record_sync(
|
||||||
|
&self,
|
||||||
|
glean: &Glean,
|
||||||
|
timestamp: u64,
|
||||||
|
extra: HashMap<String, String>,
|
||||||
|
) -> bool {
|
||||||
if !self.should_record(glean) {
|
if !self.should_record(glean) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let extra_strings = match self.validate_extra(glean, extra) {
|
let extra_strings = match self.validate_extra(glean, extra) {
|
||||||
Ok(extra) => extra,
|
Ok(extra) => extra,
|
||||||
Err(()) => return,
|
Err(()) => return false,
|
||||||
};
|
};
|
||||||
|
|
||||||
glean
|
glean
|
||||||
.event_storage()
|
.event_storage()
|
||||||
.record(glean, &self.meta, timestamp, extra_strings);
|
.record(glean, &self.meta, timestamp, extra_strings)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// **Test-only API (exported for FFI purposes).**
|
/// **Test-only API (exported for FFI purposes).**
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,14 @@ impl MemoryDistributionMetric {
|
||||||
sample = MAX_BYTES;
|
sample = MAX_BYTES;
|
||||||
}
|
}
|
||||||
|
|
||||||
glean
|
// Let's be defensive here:
|
||||||
.storage()
|
// The uploader tries to store some memory distribution metrics,
|
||||||
.record_with(glean, &self.meta, |old_value| match old_value {
|
// but in tests that storage might be gone already.
|
||||||
|
// Let's just ignore those.
|
||||||
|
// We do the same for counters and timing distributions.
|
||||||
|
// This should never happen in real app usage.
|
||||||
|
if let Some(storage) = glean.storage_opt() {
|
||||||
|
storage.record_with(glean, &self.meta, |old_value| match old_value {
|
||||||
Some(Metric::MemoryDistribution(mut hist)) => {
|
Some(Metric::MemoryDistribution(mut hist)) => {
|
||||||
hist.accumulate(sample);
|
hist.accumulate(sample);
|
||||||
Metric::MemoryDistribution(hist)
|
Metric::MemoryDistribution(hist)
|
||||||
|
|
@ -125,6 +130,12 @@ impl MemoryDistributionMetric {
|
||||||
Metric::MemoryDistribution(hist)
|
Metric::MemoryDistribution(hist)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
log::warn!(
|
||||||
|
"Couldn't get storage. Can't record memory distribution '{}'.",
|
||||||
|
self.meta.base_identifier()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Accumulates the provided signed samples in the metric.
|
/// Accumulates the provided signed samples in the metric.
|
||||||
|
|
|
||||||
|
|
@ -6,31 +6,35 @@ use std::{collections::HashMap, convert::TryFrom};
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Represents a list of metrics and their associated `disabled` property from the
|
/// Represents a list of metrics and an associated boolean property
|
||||||
/// remote-settings configuration store. The expected format of this data is stringified
|
/// indicating if the metric is enabledfrom the remote-settings
|
||||||
/// JSON in the following format:
|
/// configuration store. The expected format of this data is stringified JSON
|
||||||
|
/// in the following format:
|
||||||
/// ```json
|
/// ```json
|
||||||
/// {
|
/// {
|
||||||
/// "category.metric_name": true
|
/// "category.metric_name": true
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
||||||
pub struct MetricsDisabledConfig {
|
pub struct MetricsEnabledConfig {
|
||||||
/// This is a `HashMap` consisting of base_identifiers as keys
|
/// This is a `HashMap` consisting of base_identifiers as keys
|
||||||
/// and bool values representing an override for the `disabled`
|
/// and bool values representing an override for the `disabled`
|
||||||
/// property of the metric
|
/// property of the metric, only inverted to reduce confusion.
|
||||||
|
/// If a particular metric has a value of `true` here, it means
|
||||||
|
/// the default of the metric will be overriden and set to the
|
||||||
|
/// enabled state.
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub metrics_disabled: HashMap<String, bool>,
|
pub metrics_enabled: HashMap<String, bool>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MetricsDisabledConfig {
|
impl MetricsEnabledConfig {
|
||||||
/// Creates a new MetricsDisabledConfig
|
/// Creates a new MetricsEnabledConfig
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Default::default()
|
Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<String> for MetricsDisabledConfig {
|
impl TryFrom<String> for MetricsEnabledConfig {
|
||||||
type Error = crate::ErrorKind;
|
type Error = crate::ErrorKind;
|
||||||
|
|
||||||
fn try_from(json: String) -> Result<Self, Self::Error> {
|
fn try_from(json: String) -> Result<Self, Self::Error> {
|
||||||
15
third_party/rust/glean-core/src/metrics/mod.rs
vendored
15
third_party/rust/glean-core/src/metrics/mod.rs
vendored
|
|
@ -21,7 +21,7 @@ mod experiment;
|
||||||
pub(crate) mod labeled;
|
pub(crate) mod labeled;
|
||||||
mod memory_distribution;
|
mod memory_distribution;
|
||||||
mod memory_unit;
|
mod memory_unit;
|
||||||
mod metrics_disabled_config;
|
mod metrics_enabled_config;
|
||||||
mod numerator;
|
mod numerator;
|
||||||
mod ping;
|
mod ping;
|
||||||
mod quantity;
|
mod quantity;
|
||||||
|
|
@ -69,7 +69,7 @@ pub use self::uuid::UuidMetric;
|
||||||
pub use crate::histogram::HistogramType;
|
pub use crate::histogram::HistogramType;
|
||||||
pub use recorded_experiment::RecordedExperiment;
|
pub use recorded_experiment::RecordedExperiment;
|
||||||
|
|
||||||
pub use self::metrics_disabled_config::MetricsDisabledConfig;
|
pub use self::metrics_enabled_config::MetricsEnabledConfig;
|
||||||
|
|
||||||
/// A snapshot of all buckets and the accumulated sum of a distribution.
|
/// A snapshot of all buckets and the accumulated sum of a distribution.
|
||||||
//
|
//
|
||||||
|
|
@ -195,11 +195,11 @@ pub trait MetricType {
|
||||||
}
|
}
|
||||||
// The epoch's didn't match so we need to look up the disabled flag
|
// The epoch's didn't match so we need to look up the disabled flag
|
||||||
// by the base_identifier from the in-memory HashMap
|
// by the base_identifier from the in-memory HashMap
|
||||||
let metrics_disabled = &glean
|
let metrics_enabled = &glean
|
||||||
.remote_settings_metrics_config
|
.remote_settings_metrics_config
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.metrics_disabled;
|
.metrics_enabled;
|
||||||
// Get the value from the remote configuration if it is there, otherwise return the default value.
|
// Get the value from the remote configuration if it is there, otherwise return the default value.
|
||||||
let current_disabled = {
|
let current_disabled = {
|
||||||
let base_id = self.meta().base_identifier();
|
let base_id = self.meta().base_identifier();
|
||||||
|
|
@ -207,8 +207,11 @@ pub trait MetricType {
|
||||||
.split_once('/')
|
.split_once('/')
|
||||||
.map(|split| split.0)
|
.map(|split| split.0)
|
||||||
.unwrap_or(&base_id);
|
.unwrap_or(&base_id);
|
||||||
if let Some(is_disabled) = metrics_disabled.get(identifier) {
|
// NOTE: The `!` preceding the `*is_enabled` is important for inverting the logic since the
|
||||||
u8::from(*is_disabled)
|
// underlying property in the metrics.yaml is `disabled` and the outward API is treating it as
|
||||||
|
// if it were `enabled` to make it easier to understand.
|
||||||
|
if let Some(is_enabled) = metrics_enabled.get(identifier) {
|
||||||
|
u8::from(!*is_enabled)
|
||||||
} else {
|
} else {
|
||||||
u8::from(self.meta().inner.disabled)
|
u8::from(self.meta().inner.disabled)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
15
third_party/rust/glean-core/src/upload/mod.rs
vendored
15
third_party/rust/glean-core/src/upload/mod.rs
vendored
|
|
@ -21,11 +21,15 @@ use std::sync::{Arc, RwLock, RwLockWriteGuard};
|
||||||
use std::thread;
|
use std::thread;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
|
use chrono::Utc;
|
||||||
|
|
||||||
use crate::error::ErrorKind;
|
use crate::error::ErrorKind;
|
||||||
use crate::TimerId;
|
use crate::TimerId;
|
||||||
use crate::{internal_metrics::UploadMetrics, Glean};
|
use crate::{internal_metrics::UploadMetrics, Glean};
|
||||||
use directory::{PingDirectoryManager, PingPayloadsByDirectory};
|
use directory::{PingDirectoryManager, PingPayloadsByDirectory};
|
||||||
use policy::Policy;
|
use policy::Policy;
|
||||||
|
use request::create_date_header_value;
|
||||||
|
|
||||||
pub use request::{HeaderMap, PingRequest};
|
pub use request::{HeaderMap, PingRequest};
|
||||||
pub use result::{UploadResult, UploadTaskAction};
|
pub use result::{UploadResult, UploadTaskAction};
|
||||||
|
|
||||||
|
|
@ -605,9 +609,14 @@ impl PingUploadManager {
|
||||||
in_flight.insert(request.document_id.clone(), (success_id, failure_id));
|
in_flight.insert(request.document_id.clone(), (success_id, failure_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
PingUploadTask::Upload {
|
let mut request = queue.pop_front().unwrap();
|
||||||
request: queue.pop_front().unwrap(),
|
|
||||||
}
|
// Adding the `Date` header just before actual upload happens.
|
||||||
|
request
|
||||||
|
.headers
|
||||||
|
.insert("Date".to_string(), create_date_header_value(Utc::now()));
|
||||||
|
|
||||||
|
PingUploadTask::Upload { request }
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
log::info!("No more pings to upload! You are done.");
|
log::info!("No more pings to upload! You are done.");
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use crate::system;
|
||||||
pub type HeaderMap = HashMap<String, String>;
|
pub type HeaderMap = HashMap<String, String>;
|
||||||
|
|
||||||
/// Creates a formatted date string that can be used with Date headers.
|
/// Creates a formatted date string that can be used with Date headers.
|
||||||
fn create_date_header_value(current_time: DateTime<Utc>) -> String {
|
pub(crate) fn create_date_header_value(current_time: DateTime<Utc>) -> String {
|
||||||
// Date headers are required to be in the following format:
|
// Date headers are required to be in the following format:
|
||||||
//
|
//
|
||||||
// <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
|
// <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
|
||||||
|
|
@ -68,7 +68,6 @@ impl Builder {
|
||||||
/// Creates a new builder for a PingRequest.
|
/// Creates a new builder for a PingRequest.
|
||||||
pub fn new(language_binding_name: &str, body_max_size: usize) -> Self {
|
pub fn new(language_binding_name: &str, body_max_size: usize) -> Self {
|
||||||
let mut headers = HashMap::new();
|
let mut headers = HashMap::new();
|
||||||
headers.insert("Date".to_string(), create_date_header_value(Utc::now()));
|
|
||||||
headers.insert(
|
headers.insert(
|
||||||
"X-Telemetry-Agent".to_string(),
|
"X-Telemetry-Agent".to_string(),
|
||||||
create_x_telemetry_agent_header_value(
|
create_x_telemetry_agent_header_value(
|
||||||
|
|
@ -265,10 +264,12 @@ mod test {
|
||||||
assert_eq!(request.path, "/random/path/doesnt/matter");
|
assert_eq!(request.path, "/random/path/doesnt/matter");
|
||||||
|
|
||||||
// Make sure all the expected headers were added.
|
// Make sure all the expected headers were added.
|
||||||
assert!(request.headers.contains_key("Date"));
|
|
||||||
assert!(request.headers.contains_key("X-Telemetry-Agent"));
|
assert!(request.headers.contains_key("X-Telemetry-Agent"));
|
||||||
assert!(request.headers.contains_key("Content-Type"));
|
assert!(request.headers.contains_key("Content-Type"));
|
||||||
assert!(request.headers.contains_key("Content-Length"));
|
assert!(request.headers.contains_key("Content-Length"));
|
||||||
|
|
||||||
|
// the `Date` header is added by the `get_upload_task` just before
|
||||||
|
// returning the upload request
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
2
third_party/rust/glean/.cargo-checksum.json
vendored
2
third_party/rust/glean/.cargo-checksum.json
vendored
|
|
@ -1 +1 @@
|
||||||
{"files":{"Cargo.toml":"794cb4c811e030330df0a32cc2dcc5778e9749ae69857e90fef4061f61a973b5","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"5627cc81e6187ab6c2b4dff061af16d559edcab64ba786bac39daa69c703c595","src/common_test.rs":"de47b53dcca37985c0a2b8c02daecbf32309aa54f5a4dd9290719c2c1fd0fa55","src/configuration.rs":"4ca9be0a49a9c50f4ebe868d4bfa04fe27619c871a436911f850b4dcf6e7a7b2","src/core_metrics.rs":"dd17b482613894af08b51a2cff6dc1e84a6dbd853c14a55566e6698348941ced","src/lib.rs":"2eb1b09f2f8a649729cd27222f0889eed7b50940fc7e2bb27de54abbdac439df","src/net/http_uploader.rs":"43812a70d19a38e8d7a093c8076c2b6345372c3c861b0f3511428762700a65e0","src/net/mod.rs":"e36e170a8e53530f8705988eea694ed7c55f50bb0ce403c0facbfb75ce03ac7f","src/private/event.rs":"02bbebf545695812e5055741cc0b5f3c99eda2039e684e26fcdd5f087ed15fe3","src/private/mod.rs":"0364ecf5f0439443a5b209583f4ff2c474b79f7c253c981ab0b7cdc528368698","src/private/ping.rs":"cbdc57f41fc9d46e56b4dfff91ac683753d1f8b3ecd0aa9bc3419e3595b8b81b","src/system.rs":"6eae5b41c15eba9cad6dbd116abe3519ee3e1fe034e79bdd692b029829a8c384","src/test.rs":"d367c85a106df58272b8a779da1769664ba8a39357fd650d9f21c21855b38906","tests/common/mod.rs":"37cd4c48e140c793b852ae09fb3e812da28a4412977295015bcbffd632fcf294","tests/init_fails.rs":"28fd7726e76ca1295eb0905eca0b2ec65b0accfa28432c9ff90ec8f92616fc79","tests/never_init.rs":"1f33b8ce7ca3514b57b48cc16d98408974c85cf8aa7d13257ffc2ad878ebb295","tests/no_time_to_init.rs":"e7df75b47897fbf2c860a2e1c1c225b57598b8d1a39125ca897fe8d825bf0338","tests/overflowing_preinit.rs":"7ad4b2274dd9240b53430859a4eb1d2597cf508a5a678333f3d3abbadd2ed4a7","tests/persist_ping_lifetime.rs":"81415dc1d74743f02269f0d0dfa524003147056853f080276972e64a0b761d3c","tests/persist_ping_lifetime_nopanic.rs":"18379d3ffbf4a2c8c684c04ff7a0660b86dfbbb447db2d24dfed6073cb7ddf8f","tests/schema.rs":"ea93fcf68e00ae803031dba9b93edac0713f17e375287c32c35512ba69d5f100","tests/simple.rs":"b099034b0599bdf4650e0fa09991a8413fc5fbf397755fc06c8963d4c7c8dfa6","tests/test-shutdown-blocking.sh":"9b16a01c190c7062474dd92182298a3d9a27928c8fa990340fdd798e6cdb7ab2","tests/upload_timing.rs":"d044fce7c783133e385671ea37d674e5a1b4120cae7b07708dcd825addfa0ee3"},"package":"e1bd184ec51a21129cb58a1b7380250d5f71de01b3461ab3b81594e0a2322123"}
|
{"files":{"Cargo.toml":"0e3ae5c53f426d43d6a6106c8cbeb980805376447d9f54155550770979127f2f","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"5627cc81e6187ab6c2b4dff061af16d559edcab64ba786bac39daa69c703c595","src/common_test.rs":"de47b53dcca37985c0a2b8c02daecbf32309aa54f5a4dd9290719c2c1fd0fa55","src/configuration.rs":"4ca9be0a49a9c50f4ebe868d4bfa04fe27619c871a436911f850b4dcf6e7a7b2","src/core_metrics.rs":"dd17b482613894af08b51a2cff6dc1e84a6dbd853c14a55566e6698348941ced","src/lib.rs":"6b486cda2c92ab49dbc26533f1aac5b0b1a071b227ddd9b9e85c0edb768fe5bc","src/net/http_uploader.rs":"43812a70d19a38e8d7a093c8076c2b6345372c3c861b0f3511428762700a65e0","src/net/mod.rs":"e36e170a8e53530f8705988eea694ed7c55f50bb0ce403c0facbfb75ce03ac7f","src/private/event.rs":"02bbebf545695812e5055741cc0b5f3c99eda2039e684e26fcdd5f087ed15fe3","src/private/mod.rs":"0364ecf5f0439443a5b209583f4ff2c474b79f7c253c981ab0b7cdc528368698","src/private/ping.rs":"cbdc57f41fc9d46e56b4dfff91ac683753d1f8b3ecd0aa9bc3419e3595b8b81b","src/system.rs":"6eae5b41c15eba9cad6dbd116abe3519ee3e1fe034e79bdd692b029829a8c384","src/test.rs":"d367c85a106df58272b8a779da1769664ba8a39357fd650d9f21c21855b38906","tests/common/mod.rs":"37cd4c48e140c793b852ae09fb3e812da28a4412977295015bcbffd632fcf294","tests/init_fails.rs":"28fd7726e76ca1295eb0905eca0b2ec65b0accfa28432c9ff90ec8f92616fc79","tests/never_init.rs":"1f33b8ce7ca3514b57b48cc16d98408974c85cf8aa7d13257ffc2ad878ebb295","tests/no_time_to_init.rs":"e7df75b47897fbf2c860a2e1c1c225b57598b8d1a39125ca897fe8d825bf0338","tests/overflowing_preinit.rs":"7ad4b2274dd9240b53430859a4eb1d2597cf508a5a678333f3d3abbadd2ed4a7","tests/persist_ping_lifetime.rs":"81415dc1d74743f02269f0d0dfa524003147056853f080276972e64a0b761d3c","tests/persist_ping_lifetime_nopanic.rs":"18379d3ffbf4a2c8c684c04ff7a0660b86dfbbb447db2d24dfed6073cb7ddf8f","tests/schema.rs":"1b7b19aec54a24c2bdd4738cf33c16802c19c83504c4d0e6bcfc19142877acdb","tests/simple.rs":"b099034b0599bdf4650e0fa09991a8413fc5fbf397755fc06c8963d4c7c8dfa6","tests/test-shutdown-blocking.sh":"9b16a01c190c7062474dd92182298a3d9a27928c8fa990340fdd798e6cdb7ab2","tests/upload_timing.rs":"d044fce7c783133e385671ea37d674e5a1b4120cae7b07708dcd825addfa0ee3"},"package":"cd952afea9a760de2fc9f5d15f204f0ffa42178f8b77787d3b282c0b3dd1f398"}
|
||||||
4
third_party/rust/glean/Cargo.toml
vendored
4
third_party/rust/glean/Cargo.toml
vendored
|
|
@ -13,7 +13,7 @@
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.62"
|
rust-version = "1.62"
|
||||||
name = "glean"
|
name = "glean"
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
authors = [
|
authors = [
|
||||||
"Jan-Erik Rediger <jrediger@mozilla.com>",
|
"Jan-Erik Rediger <jrediger@mozilla.com>",
|
||||||
"The Glean Team <glean-team@mozilla.com>",
|
"The Glean Team <glean-team@mozilla.com>",
|
||||||
|
|
@ -43,7 +43,7 @@ features = ["serde"]
|
||||||
version = "0.5"
|
version = "0.5"
|
||||||
|
|
||||||
[dependencies.glean-core]
|
[dependencies.glean-core]
|
||||||
version = "52.4.2"
|
version = "52.5.0"
|
||||||
|
|
||||||
[dependencies.inherent]
|
[dependencies.inherent]
|
||||||
version = "1"
|
version = "1"
|
||||||
|
|
|
||||||
6
third_party/rust/glean/src/lib.rs
vendored
6
third_party/rust/glean/src/lib.rs
vendored
|
|
@ -170,9 +170,9 @@ pub fn set_experiment_inactive(experiment_id: String) {
|
||||||
|
|
||||||
/// Set the remote configuration values for the metrics' disabled property
|
/// Set the remote configuration values for the metrics' disabled property
|
||||||
///
|
///
|
||||||
/// See [`glean_core::Glean::set_metrics_disabled_config`].
|
/// See [`glean_core::Glean::set_metrics_enabled_config`].
|
||||||
pub fn glean_set_metrics_disabled_config(json: String) {
|
pub fn glean_set_metrics_enabled_config(json: String) {
|
||||||
glean_core::glean_set_metrics_disabled_config(json)
|
glean_core::glean_set_metrics_enabled_config(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Performs the collection/cleanup operations required by becoming active.
|
/// Performs the collection/cleanup operations required by becoming active.
|
||||||
|
|
|
||||||
4
third_party/rust/glean/tests/schema.rs
vendored
4
third_party/rust/glean/tests/schema.rs
vendored
|
|
@ -115,6 +115,10 @@ fn validate_against_schema() {
|
||||||
stringlist_metric.add("one".into());
|
stringlist_metric.add("one".into());
|
||||||
stringlist_metric.add("two".into());
|
stringlist_metric.add("two".into());
|
||||||
|
|
||||||
|
// Let's make sure an empty array is accepted.
|
||||||
|
let stringlist_metric2 = StringListMetric::new(common("stringlist2"));
|
||||||
|
stringlist_metric2.set(vec![]);
|
||||||
|
|
||||||
let timespan_metric = TimespanMetric::new(common("timespan"), TimeUnit::Nanosecond);
|
let timespan_metric = TimespanMetric::new(common("timespan"), TimeUnit::Nanosecond);
|
||||||
timespan_metric.start();
|
timespan_metric.start();
|
||||||
timespan_metric.stop();
|
timespan_metric.stop();
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ edition = "2018"
|
||||||
license = "MPL-2.0"
|
license = "MPL-2.0"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
glean = "52.4.2"
|
glean = "52.5.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
nserror = { path = "../../../xpcom/rust/nserror" }
|
nserror = { path = "../../../xpcom/rust/nserror" }
|
||||||
nsstring = { path = "../../../xpcom/rust/nsstring" }
|
nsstring = { path = "../../../xpcom/rust/nsstring" }
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ license = "MPL-2.0"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bincode = "1.0"
|
bincode = "1.0"
|
||||||
chrono = "0.4.10"
|
chrono = "0.4.10"
|
||||||
glean = "52.4.2"
|
glean = "52.5.0"
|
||||||
inherent = "1.0.0"
|
inherent = "1.0.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
nsstring = { path = "../../../../xpcom/rust/nsstring", optional = true }
|
nsstring = { path = "../../../../xpcom/rust/nsstring", optional = true }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue