summaryrefslogtreecommitdiffstats
path: root/third_party/rust/glean
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/glean')
-rw-r--r--third_party/rust/glean/.cargo-checksum.json2
-rw-r--r--third_party/rust/glean/Cargo.toml4
-rw-r--r--third_party/rust/glean/src/lib.rs10
-rw-r--r--third_party/rust/glean/src/private/ping.rs11
-rw-r--r--third_party/rust/glean/src/test.rs29
-rw-r--r--third_party/rust/glean/tests/init_fails.rs5
-rw-r--r--third_party/rust/glean/tests/never_init.rs5
-rw-r--r--third_party/rust/glean/tests/no_time_to_init.rs5
-rw-r--r--third_party/rust/glean/tests/schema.rs3
-rw-r--r--third_party/rust/glean/tests/simple.rs5
-rwxr-xr-xthird_party/rust/glean/tests/test-shutdown-blocking.sh2
-rwxr-xr-xthird_party/rust/glean/tests/test-thread-crashing.sh2
-rw-r--r--third_party/rust/glean/tests/upload_timing.rs5
13 files changed, 59 insertions, 29 deletions
diff --git a/third_party/rust/glean/.cargo-checksum.json b/third_party/rust/glean/.cargo-checksum.json
index 7cb5c7390c..76c4772b8e 100644
--- a/third_party/rust/glean/.cargo-checksum.json
+++ b/third_party/rust/glean/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"af0535de86b60e3e08cadcdb9e61ce4a699c168608d7e9e2ebb92d949e7f31ef","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"5627cc81e6187ab6c2b4dff061af16d559edcab64ba786bac39daa69c703c595","src/common_test.rs":"de47b53dcca37985c0a2b8c02daecbf32309aa54f5a4dd9290719c2c1fd0fa55","src/configuration.rs":"27075b12236021c54d0c99427bcbd417933ca02545275604d3c13f32ca25af13","src/core_metrics.rs":"fef8fb4e5fa57c179836c6eb2cf59278fe3b8b036dbe57b0ff02971b4acd822f","src/lib.rs":"d4010f265de330081467673df05bbd45efbdfeef28823f7dc11a903b11fb8976","src/net/http_uploader.rs":"01ad5bd91384411a12c74434cd1c5cd585078cb34faba4615c70bdb669a9bccb","src/net/mod.rs":"f47b96bb878f1a6c771cedbaeaeefb270bc87fb1d1bbbed1b282dddca16216ed","src/private/event.rs":"d7c70c02648584c19c73af89e5180d3c6153c911f2c6830f7d1599b18d6150eb","src/private/mod.rs":"3565eb569d2b96f938f130abe0fc3ee3f55e7e03fd6501e309d3ef6af72ef6ee","src/private/object.rs":"3f70363a196aea46cc163af025a53e48c117c6208babc4bce772bb4c337cced8","src/private/ping.rs":"a6262a3453c77cbf30766c19b535a1bf66a37b2a316e8f87baee03025255c33e","src/system.rs":"6eae5b41c15eba9cad6dbd116abe3519ee3e1fe034e79bdd692b029829a8c384","src/test.rs":"6388b9e8bf96e0fb56ad71b7a5b5630d209ae62f1a65c62e878cbc1757ddd585","tests/common/mod.rs":"08fb9483d9b6ed9fe873b4395245166ae8a15263be750c7a8e298c41d9604745","tests/init_fails.rs":"906bbf0faa613976623e0cf782bd86545b49d76afaab182af7634690b747ebf7","tests/never_init.rs":"19bad996e22f7d6958cc1a650528530aa7d1aeb4a8ab42229a90bbc0315c8ed1","tests/no_time_to_init.rs":"06c81148c27d383cb708c0c80a2e806024c9955337d7adfba8c53aaeade9be67","tests/overflowing_preinit.rs":"7ad4b2274dd9240b53430859a4eb1d2597cf508a5a678333f3d3abbadd2ed4a7","tests/persist_ping_lifetime.rs":"81415dc1d74743f02269f0d0dfa524003147056853f080276972e64a0b761d3c","tests/persist_ping_lifetime_nopanic.rs":"18379d3ffbf4a2c8c684c04ff7a0660b86dfbbb447db2d24dfed6073cb7ddf8f","tests/schema.rs":"9615eded31a2582c8f04c729d551c0c81a57029ba62a19184221c2e1cd39baf0","tests/simple.rs":"1b8b227249ae9d3cc281db07ed779bc75252c7849b1c48b4ac3d765228d65b20","tests/test-shutdown-blocking.sh":"9b16a01c190c7062474dd92182298a3d9a27928c8fa990340fdd798e6cdb7ab2","tests/test-thread-crashing.sh":"ff1bc8e5d7e4ba3a10d0d38bef222db8bfba469e7d30e45b1053d177a4084f09","tests/upload_timing.rs":"3024b7999a0c23f2c3d7e59725b5455522e4e9fdf63e3265b93fea4cec18725f"},"package":"0ceede8fb9c90ba1b77fb8290d3ae7b62bfcb422ad1d6e46bae1c8af3f22f12d"} \ No newline at end of file
+{"files":{"Cargo.toml":"f6e4a46a08d708810f6f0fc0461c4ebc246d5d656b2ed3a1bff4bdd774911c84","LICENSE":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","README.md":"5627cc81e6187ab6c2b4dff061af16d559edcab64ba786bac39daa69c703c595","src/common_test.rs":"de47b53dcca37985c0a2b8c02daecbf32309aa54f5a4dd9290719c2c1fd0fa55","src/configuration.rs":"27075b12236021c54d0c99427bcbd417933ca02545275604d3c13f32ca25af13","src/core_metrics.rs":"fef8fb4e5fa57c179836c6eb2cf59278fe3b8b036dbe57b0ff02971b4acd822f","src/lib.rs":"21d670de3713a20a7a741f8ff6d6bde4329be44beeca037e32f22cce53a1bea2","src/net/http_uploader.rs":"01ad5bd91384411a12c74434cd1c5cd585078cb34faba4615c70bdb669a9bccb","src/net/mod.rs":"f47b96bb878f1a6c771cedbaeaeefb270bc87fb1d1bbbed1b282dddca16216ed","src/private/event.rs":"d7c70c02648584c19c73af89e5180d3c6153c911f2c6830f7d1599b18d6150eb","src/private/mod.rs":"3565eb569d2b96f938f130abe0fc3ee3f55e7e03fd6501e309d3ef6af72ef6ee","src/private/object.rs":"3f70363a196aea46cc163af025a53e48c117c6208babc4bce772bb4c337cced8","src/private/ping.rs":"31d33d7f661a7a17ccb69351328700b4d7b80024d1e128f406c3534f9d163475","src/system.rs":"6eae5b41c15eba9cad6dbd116abe3519ee3e1fe034e79bdd692b029829a8c384","src/test.rs":"39dd7468dcdaf17593b8b07970ced25c07cbd76853aaef2532fdcad0281a21d3","tests/common/mod.rs":"08fb9483d9b6ed9fe873b4395245166ae8a15263be750c7a8e298c41d9604745","tests/init_fails.rs":"46d7064bba9386c3065635434e17ac9212c6c2236b3cd12bd985fc3229e659a3","tests/never_init.rs":"7a6e8a011fbd945f2544f204367eeceff3f6039c99d98799477e3b2352ae6227","tests/no_time_to_init.rs":"4a5bdddc2f8226d2ad17038229e8767a6dd195977af49527fbb84a9f6b0154bb","tests/overflowing_preinit.rs":"7ad4b2274dd9240b53430859a4eb1d2597cf508a5a678333f3d3abbadd2ed4a7","tests/persist_ping_lifetime.rs":"81415dc1d74743f02269f0d0dfa524003147056853f080276972e64a0b761d3c","tests/persist_ping_lifetime_nopanic.rs":"18379d3ffbf4a2c8c684c04ff7a0660b86dfbbb447db2d24dfed6073cb7ddf8f","tests/schema.rs":"dde65bce8a715ca3bd9c54b2466d831dd5e0d559e0773fe7657827f22a66bb44","tests/simple.rs":"1835b5df6f76ff894b45805bd54eaab23ca2d9d2b0694ec64af3aa6132baf30e","tests/test-shutdown-blocking.sh":"a44d8d4bbe2ee3ede9e48121150ae7a5386025160c5cef2181ca142232c5fb27","tests/test-thread-crashing.sh":"8d5ed070754e09fbe55183bb2792ae6e234a95770e39397caf05e4ec4d6015db","tests/upload_timing.rs":"6a97aa355d808123af0914ffecf1da0ecb2cc441c95c63c600b14f97ce0d45a0"},"package":"188984f86678ca6ef88beb79cb743128549946858523d516466d6e94d05fc911"} \ No newline at end of file
diff --git a/third_party/rust/glean/Cargo.toml b/third_party/rust/glean/Cargo.toml
index edcc84d5d6..db7aa95f21 100644
--- a/third_party/rust/glean/Cargo.toml
+++ b/third_party/rust/glean/Cargo.toml
@@ -13,7 +13,7 @@
edition = "2021"
rust-version = "1.66"
name = "glean"
-version = "59.0.0"
+version = "60.0.1"
authors = [
"Jan-Erik Rediger <jrediger@mozilla.com>",
"The Glean Team <glean-team@mozilla.com>",
@@ -35,7 +35,7 @@ license = "MPL-2.0"
repository = "https://github.com/mozilla/glean"
[dependencies.glean-core]
-version = "59.0.0"
+version = "=60.0.1"
[dependencies.inherent]
version = "1"
diff --git a/third_party/rust/glean/src/lib.rs b/third_party/rust/glean/src/lib.rs
index 81899d42ee..7f7f2c48be 100644
--- a/third_party/rust/glean/src/lib.rs
+++ b/third_party/rust/glean/src/lib.rs
@@ -23,7 +23,7 @@
//! let cfg = ConfigurationBuilder::new(true, "/tmp/data", "org.mozilla.glean_core.example").build();
//! glean::initialize(cfg, ClientInfoMetrics::unknown());
//!
-//! let prototype_ping = PingType::new("prototype", true, true, true, true, vec!());
+//! let prototype_ping = PingType::new("prototype", true, true, true, true, true, vec!(), vec!());
//!
//! prototype_ping.submit(None);
//! ```
@@ -187,9 +187,9 @@ pub fn test_get_experimentation_id() -> Option<String> {
/// Set the remote configuration values for the metrics' disabled property
///
-/// See [`glean_core::Glean::set_metrics_enabled_config`].
-pub fn glean_set_metrics_enabled_config(json: String) {
- glean_core::glean_set_metrics_enabled_config(json)
+/// See [`glean_core::Glean::glean_apply_server_knobs_config`].
+pub fn glean_apply_server_knobs_config(json: String) {
+ glean_core::glean_apply_server_knobs_config(json)
}
/// Performs the collection/cleanup operations required by becoming active.
@@ -293,7 +293,7 @@ pub fn get_timestamp_ms() -> u64 {
/// If Glean hasn't been initialized this will dispatch and return Ok(()),
/// otherwise it will block until the persist is done and return its Result.
pub fn persist_ping_lifetime_data() {
- glean_core::persist_ping_lifetime_data();
+ glean_core::glean_persist_ping_lifetime_data();
}
#[cfg(test)]
diff --git a/third_party/rust/glean/src/private/ping.rs b/third_party/rust/glean/src/private/ping.rs
index 6c126992bc..b54eec91a6 100644
--- a/third_party/rust/glean/src/private/ping.rs
+++ b/third_party/rust/glean/src/private/ping.rs
@@ -27,13 +27,22 @@ impl PingType {
/// * `name` - The name of the ping.
/// * `include_client_id` - Whether to include the client ID in the assembled ping when.
/// * `send_if_empty` - Whether the ping should be sent empty or not.
+ /// * `precise_timestamps` - Whether the ping should use precise timestamps for the start and end time.
+ /// * `include_info_sections` - Whether the ping should include the client/ping_info sections.
+ /// * `enabled` - Whether or not this ping is enabled. Note: Data that would be sent on a disabled
+ /// ping will still be collected and is discarded instead of being submitted.
+ /// * `schedules_pings` - A list of pings which are triggered for submission when this ping is
+ /// submitted.
/// * `reason_codes` - The valid reason codes for this ping.
+ #[allow(clippy::too_many_arguments)]
pub fn new<A: Into<String>>(
name: A,
include_client_id: bool,
send_if_empty: bool,
precise_timestamps: bool,
include_info_sections: bool,
+ enabled: bool,
+ schedules_pings: Vec<String>,
reason_codes: Vec<String>,
) -> Self {
let inner = glean_core::metrics::PingType::new(
@@ -42,6 +51,8 @@ impl PingType {
send_if_empty,
precise_timestamps,
include_info_sections,
+ enabled,
+ schedules_pings,
reason_codes,
);
diff --git a/third_party/rust/glean/src/test.rs b/third_party/rust/glean/src/test.rs
index 16d6d05447..c547cabccd 100644
--- a/third_party/rust/glean/src/test.rs
+++ b/third_party/rust/glean/src/test.rs
@@ -49,7 +49,8 @@ fn send_a_ping() {
// Define a new ping and submit it.
const PING_NAME: &str = "test-ping";
- let custom_ping = private::PingType::new(PING_NAME, true, true, true, true, vec![]);
+ let custom_ping =
+ private::PingType::new(PING_NAME, true, true, true, true, true, vec![], vec![]);
custom_ping.submit(None);
// Wait for the ping to arrive.
@@ -90,7 +91,8 @@ fn send_a_ping_without_info_sections() {
// Define a new ping and submit it.
const PING_NAME: &str = "noinfo-ping";
- let custom_ping = private::PingType::new(PING_NAME, true, true, true, false, vec![]);
+ let custom_ping =
+ private::PingType::new(PING_NAME, true, true, true, false, true, vec![], vec![]);
custom_ping.submit(None);
// Wait for the ping to arrive.
@@ -594,7 +596,7 @@ fn ping_collection_must_happen_after_concurrently_scheduled_metrics_recordings()
);
let ping_name = "custom_ping_1";
- let ping = private::PingType::new(ping_name, true, false, true, true, vec![]);
+ let ping = private::PingType::new(ping_name, true, false, true, true, true, vec![], vec![]);
let metric = private::StringMetric::new(CommonMetricData {
name: "string_metric".into(),
category: "telemetry".into(),
@@ -1097,7 +1099,16 @@ fn flipping_upload_enabled_respects_order_of_events() {
.build();
// We create a ping and a metric before we initialize Glean
- let sample_ping = PingType::new("sample-ping-1", true, false, true, true, vec![]);
+ let sample_ping = PingType::new(
+ "sample-ping-1",
+ true,
+ false,
+ true,
+ true,
+ true,
+ vec![],
+ vec![],
+ );
let metric = private::StringMetric::new(CommonMetricData {
name: "string_metric".into(),
category: "telemetry".into(),
@@ -1141,7 +1152,7 @@ fn registering_pings_before_init_must_work() {
}
// Create a custom ping and attempt its registration.
- let sample_ping = PingType::new("pre-register", true, true, true, true, vec![]);
+ let sample_ping = PingType::new("pre-register", true, true, true, true, true, vec![], vec![]);
// Create a custom configuration to use a fake uploader.
let dir = tempfile::tempdir().unwrap();
@@ -1193,7 +1204,7 @@ fn test_a_ping_before_submission() {
let _t = new_glean(Some(cfg), true);
// Create a custom ping and register it.
- let sample_ping = PingType::new("custom1", true, true, true, true, vec![]);
+ let sample_ping = PingType::new("custom1", true, true, true, true, true, vec![], vec![]);
let metric = CounterMetric::new(CommonMetricData {
name: "counter_metric".into(),
@@ -1310,7 +1321,8 @@ fn signaling_done() {
// Define a new ping and submit it.
const PING_NAME: &str = "test-ping";
- let custom_ping = private::PingType::new(PING_NAME, true, true, true, true, vec![]);
+ let custom_ping =
+ private::PingType::new(PING_NAME, true, true, true, true, true, vec![], vec![]);
custom_ping.submit(None);
custom_ping.submit(None);
@@ -1381,7 +1393,8 @@ fn configure_ping_throttling() {
// Define a new ping.
const PING_NAME: &str = "test-ping";
- let custom_ping = private::PingType::new(PING_NAME, true, true, true, true, vec![]);
+ let custom_ping =
+ private::PingType::new(PING_NAME, true, true, true, true, true, vec![], vec![]);
// Submit and receive it `pings_per_interval` times.
for _ in 0..pings_per_interval {
diff --git a/third_party/rust/glean/tests/init_fails.rs b/third_party/rust/glean/tests/init_fails.rs
index a0c23ca277..2ae4a91f02 100644
--- a/third_party/rust/glean/tests/init_fails.rs
+++ b/third_party/rust/glean/tests/init_fails.rs
@@ -42,8 +42,9 @@ mod pings {
use once_cell::sync::Lazy;
#[allow(non_upper_case_globals)]
- pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
+ pub static validation: Lazy<PingType> = Lazy::new(|| {
+ glean::private::PingType::new("validation", true, true, true, true, true, vec![], vec![])
+ });
}
/// Test scenario: Glean initialization fails.
diff --git a/third_party/rust/glean/tests/never_init.rs b/third_party/rust/glean/tests/never_init.rs
index 0d0d3768ff..a991ce467e 100644
--- a/third_party/rust/glean/tests/never_init.rs
+++ b/third_party/rust/glean/tests/never_init.rs
@@ -38,8 +38,9 @@ mod pings {
use once_cell::sync::Lazy;
#[allow(non_upper_case_globals)]
- pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
+ pub static validation: Lazy<PingType> = Lazy::new(|| {
+ glean::private::PingType::new("validation", true, true, true, true, true, vec![], vec![])
+ });
}
/// Test scenario: Glean is never initialized.
diff --git a/third_party/rust/glean/tests/no_time_to_init.rs b/third_party/rust/glean/tests/no_time_to_init.rs
index c312b397af..c14129c168 100644
--- a/third_party/rust/glean/tests/no_time_to_init.rs
+++ b/third_party/rust/glean/tests/no_time_to_init.rs
@@ -40,8 +40,9 @@ mod pings {
use once_cell::sync::Lazy;
#[allow(non_upper_case_globals)]
- pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
+ pub static validation: Lazy<PingType> = Lazy::new(|| {
+ glean::private::PingType::new("validation", true, true, true, true, true, vec![], vec![])
+ });
}
/// Test scenario: Glean initialization fails.
diff --git a/third_party/rust/glean/tests/schema.rs b/third_party/rust/glean/tests/schema.rs
index 59132cd82a..2909ab1dd3 100644
--- a/third_party/rust/glean/tests/schema.rs
+++ b/third_party/rust/glean/tests/schema.rs
@@ -170,7 +170,8 @@ fn validate_against_schema() {
text_metric.set("loooooong text".repeat(100));
// Define a new ping and submit it.
- let custom_ping = glean::private::PingType::new(PING_NAME, true, true, true, true, vec![]);
+ let custom_ping =
+ glean::private::PingType::new(PING_NAME, true, true, true, true, true, vec![], vec![]);
custom_ping.submit(None);
// Wait for the ping to arrive.
diff --git a/third_party/rust/glean/tests/simple.rs b/third_party/rust/glean/tests/simple.rs
index 3baa4df14e..d5c6a5244c 100644
--- a/third_party/rust/glean/tests/simple.rs
+++ b/third_party/rust/glean/tests/simple.rs
@@ -40,8 +40,9 @@ mod pings {
use once_cell::sync::Lazy;
#[allow(non_upper_case_globals)]
- pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
+ pub static validation: Lazy<PingType> = Lazy::new(|| {
+ glean::private::PingType::new("validation", true, true, true, true, true, vec![], vec![])
+ });
}
/// Test scenario: A clean run
diff --git a/third_party/rust/glean/tests/test-shutdown-blocking.sh b/third_party/rust/glean/tests/test-shutdown-blocking.sh
index 2f5d82acf0..8591aa005a 100755
--- a/third_party/rust/glean/tests/test-shutdown-blocking.sh
+++ b/third_party/rust/glean/tests/test-shutdown-blocking.sh
@@ -17,7 +17,7 @@ trap cleanup INT ABRT TERM EXIT
tmp="${TMPDIR:-/tmp}"
datapath=$(mktemp -d "${tmp}/glean_long_running.XXXX")
-cargo run --example long-running -- "$datapath"
+cargo run -p glean --example long-running -- "$datapath"
count=$(ls -1q "$datapath/pending_pings" | wc -l)
if [[ "$count" -eq 0 ]]; then
diff --git a/third_party/rust/glean/tests/test-thread-crashing.sh b/third_party/rust/glean/tests/test-thread-crashing.sh
index 1657467a33..67a0f4099c 100755
--- a/third_party/rust/glean/tests/test-thread-crashing.sh
+++ b/third_party/rust/glean/tests/test-thread-crashing.sh
@@ -19,7 +19,7 @@ datapath=$(mktemp -d "${tmp}/glean_long_running.XXXX")
RUSTFLAGS="-C panic=abort" \
RUST_LOG=debug \
-cargo run --example crashing-threads -- "$datapath"
+cargo run -p glean --example crashing-threads -- "$datapath"
ret=$?
count=$(ls -1q "$datapath/pending_pings" | wc -l)
diff --git a/third_party/rust/glean/tests/upload_timing.rs b/third_party/rust/glean/tests/upload_timing.rs
index ba0eee3402..49007cf8dc 100644
--- a/third_party/rust/glean/tests/upload_timing.rs
+++ b/third_party/rust/glean/tests/upload_timing.rs
@@ -96,8 +96,9 @@ mod pings {
use once_cell::sync::Lazy;
#[allow(non_upper_case_globals)]
- pub static validation: Lazy<PingType> =
- Lazy::new(|| glean::private::PingType::new("validation", true, true, true, true, vec![]));
+ pub static validation: Lazy<PingType> = Lazy::new(|| {
+ glean::private::PingType::new("validation", true, true, true, true, true, vec![], vec![])
+ });
}
// Define a fake uploader that sleeps.