Repository: cloudflare/daphne
Pull request #211 (2023-01-24 04:17:34)

Run `cargo upgrade`
clap 4.1.1 => 4.1.3
async-trait 0.1.62 => 0.1.63


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 7967ea6..04f76d5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -71,9 +71,9 @@ checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9"
 
 [[package]]
 name = "async-trait"
-version = "0.1.62"
+version = "0.1.63"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "689894c2db1ea643a50834b999abf1c110887402542955ff5451dab8f861f9ed"
+checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -259,9 +259,9 @@ dependencies = [
 
 [[package]]
 name = "clap"
-version = "4.1.1"
+version = "4.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2"
+checksum = "d8d93d855ce6a0aa87b8473ef9169482f40abaa2e9e0993024c35c902cbd5920"
 dependencies = [
  "bitflags",
  "clap_derive",
diff --git a/daphne/Cargo.toml b/daphne/Cargo.toml
index bb0b71d..dc5c2a9 100644
--- a/daphne/Cargo.toml
+++ b/daphne/Cargo.toml
@@ -19,7 +19,7 @@ crate-type = ["cdylib", "rlib"]
 
 [dependencies]
 assert_matches = "1.5.0"
-async-trait = "0.1.62"
+async-trait = "0.1.63"
 base64 = "0.21.0"
 getrandom = { version = "0.2.8", features = ["js"] } # Required for prio
 hex = { version = "0.4.3", features = ["serde"] }
diff --git a/daphne/dapf/Cargo.toml b/daphne/dapf/Cargo.toml
index 77913e0..f2c96d5 100644
--- a/daphne/dapf/Cargo.toml
+++ b/daphne/dapf/Cargo.toml
@@ -18,7 +18,7 @@ prio = "0.10.0"
 serde = { version = "1.0.152", features = ["derive"] }
 serde_json = "1.0.91"
 url = { version = "2.3.1", features = ["serde"] }
-clap = { version = "4.1.1", features = ["derive"] }
+clap = { version = "4.1.3", features = ["derive"] }
 reqwest = { version = "0.11.14", features = ["blocking"] }
 anyhow = "1.0.68"
 tokio = { version = "1.24.2", features = ["macros", "rt"] }
diff --git a/daphne/src/metrics.rs b/daphne/src/metrics.rs
index 96a522f..450dfeb 100644
--- a/daphne/src/metrics.rs
+++ b/daphne/src/metrics.rs
@@ -9,8 +9,6 @@ use prometheus::{register_int_counter_vec_with_registry, IntCounterVec, Registry
 pub struct DaphneMetrics {
     /// Report metrics. How many reports have been rejected, aggregated, and collected. When
     /// a report is rejected, the failure type is recorded.
-    //
-    // TODO(cjpatton) So far we only count the number of reports aggregated.
     pub(crate) report_counter: IntCounterVec,
 }
 
diff --git a/daphne/src/roles.rs b/daphne/src/roles.rs
index 37224da..bab40c7 100644
--- a/daphne/src/roles.rs
+++ b/daphne/src/roles.rs
@@ -561,6 +561,11 @@ where
         self.mark_collected(&agg_share_req.task_id, &agg_share_req.batch_sel)
             .await?;
 
+        self.metrics()
+            .report_counter
+            .with_label_values(&["collected"])
+            .inc_by(agg_share_req.report_count);
+
         Ok(agg_share_req.report_count)
     }
 
@@ -929,6 +934,11 @@ where
             encrypted_agg_share,
         };
 
+        self.metrics()
+            .report_counter
+            .with_label_values(&["collected"])
+            .inc_by(agg_share_req.report_count);
+
         Ok(DapResponse {
             media_type: Some(MEDIA_TYPE_AGG_SHARE_RESP),
             payload: agg_share_resp.get_encoded(),
diff --git a/daphne_worker/Cargo.toml b/daphne_worker/Cargo.toml
index 2d038ec..55d5b52 100644
--- a/daphne_worker/Cargo.toml
+++ b/daphne_worker/Cargo.toml
@@ -18,7 +18,7 @@ readme = "../README.md"
 crate-type = ["cdylib", "rlib"]
 
 [dependencies]
-async-trait = "0.1.62"
+async-trait = "0.1.63"
 base64 = "0.21.0"
 chrono = "0.4.23"
 daphne = { path = "../daphne" }


Test patch:
diff --git a/daphne/src/roles_test.rs b/daphne/src/roles_test.rs
index b1dcffb..1c0d894 100644
--- a/daphne/src/roles_test.rs
+++ b/daphne/src/roles_test.rs
@@ -1391,6 +1391,8 @@ async fn e2e_time_interval(version: DapVersion) {
     assert_metrics_include!(t.prometheus_registry, {
         r#"test_leader_report_counter{status="aggregated"}"#: 1,
         r#"test_helper_report_counter{status="aggregated"}"#: 1,
+        r#"test_leader_report_counter{status="collected"}"#: 1,
+        r#"test_helper_report_counter{status="collected"}"#: 1,
     });
 }
 
@@ -1419,6 +1421,8 @@ async fn e2e_fixed_size(version: DapVersion) {
     assert_metrics_include!(t.prometheus_registry, {
         r#"test_leader_report_counter{status="aggregated"}"#: 1,
         r#"test_helper_report_counter{status="aggregated"}"#: 1,
+        r#"test_leader_report_counter{status="collected"}"#: 1,
+        r#"test_helper_report_counter{status="collected"}"#: 1,
     });
 }
 
@@ -1512,6 +1516,8 @@ async fn e2e_taskprov(version: DapVersion) {
     assert_metrics_include!(t.prometheus_registry, {
         r#"test_leader_report_counter{status="aggregated"}"#: 1,
         r#"test_helper_report_counter{status="aggregated"}"#: 1,
+        r#"test_leader_report_counter{status="collected"}"#: 1,
+        r#"test_helper_report_counter{status="collected"}"#: 1,
     });
 }