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;