From dd10fa340b64a9a77b2cc9ff6b8f4779fdbb60bc Mon Sep 17 00:00:00 2001 From: Lou-Kamades Date: Tue, 26 Mar 2024 21:57:55 -0500 Subject: [PATCH] bench: add TC-1 postgres result struct --- .../src/postgres/confirmation_slot.rs | 25 +++++++++++++++++++ benchrunner-service/src/postgres/mod.rs | 1 + 2 files changed, 26 insertions(+) create mode 100644 benchrunner-service/src/postgres/confirmation_slot.rs diff --git a/benchrunner-service/src/postgres/confirmation_slot.rs b/benchrunner-service/src/postgres/confirmation_slot.rs new file mode 100644 index 00000000..549d30ec --- /dev/null +++ b/benchrunner-service/src/postgres/confirmation_slot.rs @@ -0,0 +1,25 @@ +#[derive(Debug)] +pub struct PostgresConfirmationSlot { + pub signature: String, + pub bench_datetime: SystemTime, + pub slot_sent: u64, + pub slot_confirmed: u64, + pub endpoint: String, + pub confirmed: bool, + pub confirmation_time_ms: f32, +} + +impl PostgresConfirmationSlot { + pub fn to_values() -> &[&(dyn ToSql + Sync)] { + let values: &[&(dyn ToSql + Sync)] = &[ + &self.signature, + &self.bench_datetime, + &(self.slot_sent as i64), + &(self.slot_confirmed as i64), + &self.endpoint, + &self.confirmed, + &self.confirmation_time_ms, + ]; + values + } +} diff --git a/benchrunner-service/src/postgres/mod.rs b/benchrunner-service/src/postgres/mod.rs index 3131825c..e0750dc5 100644 --- a/benchrunner-service/src/postgres/mod.rs +++ b/benchrunner-service/src/postgres/mod.rs @@ -1,3 +1,4 @@ +pub mod confirmation_slot; pub mod metrics_dbstore; pub mod postgres_session; pub mod postgres_session_cache;