Skip to content

Commit 3a827b9

Browse files
committed
Trying speed run with EnrolmentDCB (uses low-level API).
1 parent ca0f89c commit 3a827b9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/benchmark/dcb_speedrun.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from eventsourcing.persistence import ProgrammingError
1818
from eventsourcing.postgres import PostgresApplicationRecorder, PostgresDatastore
1919
from examples.coursebooking.application import EnrolmentWithAggregates
20+
from examples.coursebookingdcb.application import EnrolmentWithDCB
2021
from examples.coursebookingdcb.postgres_ts import (
2122
PG_FUNCTION_NAME_DCB_CHECK_APPEND_CONDITION_TS,
2223
PG_FUNCTION_NAME_DCB_INSERT_EVENTS_TS,
@@ -35,8 +36,8 @@
3536

3637
env = {}
3738
# SPEEDRUN_DB_NAME = "course_subscriptions_speedrun"
38-
SPEEDRUN_DB_NAME = "course_subscriptions_speedrun_tt"
39-
# SPEEDRUN_DB_NAME = "course_subscriptions_speedrun_tt2"
39+
# SPEEDRUN_DB_NAME = "course_subscriptions_speedrun_tt"
40+
SPEEDRUN_DB_NAME = "course_subscriptions_speedrun_tt2"
4041
SPEEDRUN_DB_USER = "eventsourcing"
4142
SPEEDRUN_DB_PASSWORD = "eventsourcing" # noqa: S105
4243

@@ -65,7 +66,7 @@ def inf_range() -> Iterator[int]:
6566
},
6667
),
6768
"dcb-pg-tt": (
68-
EnrolmentWithDCBRefactored,
69+
EnrolmentWithDCB,
6970
10,
7071
{
7172
"PERSISTENCE_MODULE": "eventsourcing.dcb.postgres_tt",
@@ -74,9 +75,9 @@ def inf_range() -> Iterator[int]:
7475
"POSTGRES_PORT": "5432",
7576
"POSTGRES_USER": SPEEDRUN_DB_USER,
7677
"POSTGRES_PASSWORD": SPEEDRUN_DB_PASSWORD,
77-
"POSTGRES_POOL_SIZE": "1",
78-
"POSTGRES_MAX_OVERFLOW": "0",
79-
"POSTGRES_MAX_WAITING": "0",
78+
"POSTGRES_POOL_SIZE": "5",
79+
"POSTGRES_MAX_OVERFLOW": "5",
80+
"POSTGRES_MAX_WAITING": "5",
8081
},
8182
),
8283
"dcb-mem": (
@@ -139,7 +140,7 @@ def count_events(app: EnrolmentInterface) -> int:
139140
result = conn.execute(statement).fetchone()
140141
count = result["count"] if result is not None else 0
141142

142-
elif isinstance(app, EnrolmentWithDCBRefactored):
143+
elif isinstance(app, (EnrolmentWithDCBRefactored, EnrolmentWithDCB)):
143144
recorder = app.recorder
144145
assert isinstance(recorder, (PostgresDCBRecorderTS, PostgresDCBRecorderTT))
145146
datastore = recorder.datastore

0 commit comments

Comments
 (0)