Skip to content

Commit 7702bcd

Browse files
committed
Add test for last written lsn cache
1 parent 4a05413 commit 7702bcd

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import os
2+
import statistics
3+
import threading
4+
import time
5+
import timeit
6+
from random import randint
7+
8+
import pytest
9+
from batch_others.test_backpressure import pg_cur
10+
from fixtures import log_helper
11+
from fixtures.benchmark_fixture import MetricReport
12+
from fixtures.compare_fixtures import PgCompare
13+
from fixtures.neon_fixtures import Postgres
14+
15+
from performance.test_perf_pgbench import get_scales_matrix
16+
from performance.test_backpressure import record_read_latency
17+
18+
def start_write_workload(pg: Postgres, scale: int = 10):
19+
with pg_cur(pg) as cur:
20+
cur.execute(
21+
f"create table big as select generate_series(1,{scale*100_000})")
22+
23+
@pytest.mark.parametrize("scale", get_scales_matrix(1))
24+
def test_measure_read_latency_heavy_write_workload(neon_with_baseline: PgCompare, scale: int):
25+
env = neon_with_baseline
26+
pg = env.pg
27+
28+
with pg_cur(pg) as cur:
29+
cur.execute(f"create table small as select generate_series(1,{scale*100_000})")
30+
31+
write_thread = threading.Thread(target=start_write_workload, args=(pg, scale*100))
32+
write_thread.start()
33+
34+
record_read_latency(env, write_thread, "SELECT count(*) from small")

vendor/postgres

0 commit comments

Comments
 (0)