Skip to content

Commit

Permalink
Add metrics for serial id and event time
Browse files Browse the repository at this point in the history
  • Loading branch information
danielle-tfh committed Oct 17, 2024
1 parent 285f8cb commit eb004eb
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deploy/stage/common-values-iris-mpc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: "ghcr.io/worldcoin/iris-mpc:v0.8.25"
image: "ghcr.io/worldcoin/iris-mpc:v0.8.26"

environment: stage
replicaCount: 1
Expand Down
17 changes: 17 additions & 0 deletions deploy/stage/smpcv2-0-stage/values-iris-mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ env:
- name: SMPC__MAX_BATCH_SIZE
value: "64"

- name: SMPC__SERVICE__METRICS__HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP

- name: SMPC__SERVICE__METRICS__PORT
value: "8125"

- name: SMPC__SERVICE__METRICS__QUEUE_SIZE
value: "5000"

- name: SMPC__SERVICE__METRICS__BUFFER_SIZE
value: "1024"

- name: SMPC__SERVICE__METRICS__PREFIX
value: "smpcv2-0"

initContainer:
enabled: true
image: "amazon/aws-cli:2.17.62"
Expand Down
17 changes: 17 additions & 0 deletions deploy/stage/smpcv2-1-stage/values-iris-mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ env:
- name: SMPC__MAX_BATCH_SIZE
value: "64"

- name: SMPC__SERVICE__METRICS__HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP

- name: SMPC__SERVICE__METRICS__PORT
value: "8125"

- name: SMPC__SERVICE__METRICS__QUEUE_SIZE
value: "5000"

- name: SMPC__SERVICE__METRICS__BUFFER_SIZE
value: "1024"

- name: SMPC__SERVICE__METRICS__PREFIX
value: "smpcv2-1"

initContainer:
enabled: true
image: "amazon/aws-cli:2.17.62"
Expand Down
17 changes: 17 additions & 0 deletions deploy/stage/smpcv2-2-stage/values-iris-mpc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ env:
- name: SMPC__MAX_BATCH_SIZE
value: "64"

- name: SMPC__SERVICE__METRICS__HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP

- name: SMPC__SERVICE__METRICS__PORT
value: "8125"

- name: SMPC__SERVICE__METRICS__QUEUE_SIZE
value: "5000"

- name: SMPC__SERVICE__METRICS__BUFFER_SIZE
value: "1024"

- name: SMPC__SERVICE__METRICS__PREFIX
value: "smpcv2-2"

initContainer:
enabled: true
image: "amazon/aws-cli:2.17.62"
Expand Down
2 changes: 2 additions & 0 deletions iris-mpc-gpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ serde_json.workspace = true
sodiumoxide = "0.2.7"
iris-mpc-common = { path = "../iris-mpc-common" }
base64 = "0.22.1"
metrics = "0.22.1"
metrics-exporter-statsd = "0.7"

[dev-dependencies]
criterion = "0.5"
Expand Down
2 changes: 1 addition & 1 deletion iris-mpc-gpu/src/server/actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ fn log_timers(events: HashMap<&str, Vec<Vec<CUevent>>>) {
.sum();

tracing::info!("Event {}: {:?} ms", name, duration);
// TODO: send to metrics
metrics::histogram!("duration", "event_name" => name.to_string()).record(duration);
}
}

Expand Down
3 changes: 3 additions & 0 deletions iris-mpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ iris-mpc-common = { path = "../iris-mpc-common" }
iris-mpc-store = { path = "../iris-mpc-store" }
sha2 = "0.10.8"

metrics = "0.22.1"
metrics-exporter-statsd = "0.7"

[dev-dependencies]
criterion = "0.5"
ndarray = "0.16.0"
Expand Down
5 changes: 5 additions & 0 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,11 @@ async fn server_main(config: Config) -> eyre::Result<()> {

tx.commit().await?;

for memory_serial_id in memory_serial_ids {
tracing::info!("Inserted serial_id: {}", memory_serial_id);
metrics::gauge!("results_inserted.latest_serial_id").set(memory_serial_id as f64);
}

tracing::info!("Sending {} uniqueness results", uniqueness_results.len());
send_results_to_sns(
uniqueness_results,
Expand Down

0 comments on commit eb004eb

Please sign in to comment.