Skip to content

Commit c955cda

Browse files
committed
add non-http stress test
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)
1 parent 691f002 commit c955cda

File tree

5 files changed

+478
-10
lines changed

5 files changed

+478
-10
lines changed

teos/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ path = "src/cli.rs"
1414
name = "teosd"
1515
path = "src/main.rs"
1616

17+
[[bin]]
18+
name = "stress"
19+
path = "src/stress.rs"
20+
1721
[features]
1822
# By default, enable both SQLite snd PostgreSQL in the output binary.
1923
default = ["sqlite", "postgres"]

teos/src/gatekeeper.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ pub(crate) struct AuthenticationFailure<'a>(&'a str);
4444

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

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

5555
/// Component in charge of managing access to the tower resources.
5656
///

teos/src/responder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl ConfirmationStatus {
6767
///
6868
/// It is analogous to [ExtendedAppointment](crate::extended_appointment::ExtendedAppointment) for the [`Watcher`](crate::watcher::Watcher).
6969
#[derive(Debug, Clone, PartialEq, Eq)]
70-
pub(crate) struct TransactionTracker {
70+
pub struct TransactionTracker {
7171
/// Matches the corresponding [Breach] `dispute_tx` field.
7272
pub dispute_tx: Transaction,
7373
/// Matches the corresponding [Breach] penalty_tx field.

0 commit comments

Comments
 (0)