Skip to content

Commit

Permalink
add non-http stress test
Browse files Browse the repository at this point in the history
14s writes on sqlite comparted to 4s writes on postgresql

sub 100ms read on sqlite comparted to sub 200ms reads on postgresql

using pool size = 20

50 users each sending 100 appointments

(pool size = 1 on sqlite results in 11s writes and sub 200ms reads)
  • Loading branch information
mariocynicys committed Oct 16, 2023
1 parent 691f002 commit c955cda
Show file tree
Hide file tree
Showing 5 changed files with 478 additions and 10 deletions.
4 changes: 4 additions & 0 deletions teos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ path = "src/cli.rs"
name = "teosd"
path = "src/main.rs"

[[bin]]
name = "stress"
path = "src/stress.rs"

[features]
# By default, enable both SQLite snd PostgreSQL in the output binary.
default = ["sqlite", "postgres"]
Expand Down
4 changes: 2 additions & 2 deletions teos/src/gatekeeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ pub(crate) struct AuthenticationFailure<'a>(&'a str);

/// Error raised if the user subscription has not enough slots to fit a new appointment.
#[derive(Debug, PartialEq)]
pub(crate) struct NotEnoughSlots;
pub struct NotEnoughSlots;

/// Error raised if the user subscription slots limit has been reached.
///
/// This is currently set to [u32::MAX].
#[derive(Debug, PartialEq)]
pub(crate) struct MaxSlotsReached;
pub struct MaxSlotsReached;

/// Component in charge of managing access to the tower resources.
///
Expand Down
2 changes: 1 addition & 1 deletion teos/src/responder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl ConfirmationStatus {
///
/// It is analogous to [ExtendedAppointment](crate::extended_appointment::ExtendedAppointment) for the [`Watcher`](crate::watcher::Watcher).
#[derive(Debug, Clone, PartialEq, Eq)]
pub(crate) struct TransactionTracker {
pub struct TransactionTracker {
/// Matches the corresponding [Breach] `dispute_tx` field.
pub dispute_tx: Transaction,
/// Matches the corresponding [Breach] penalty_tx field.
Expand Down
Loading

0 comments on commit c955cda

Please sign in to comment.