MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / benchmark

Function benchmark

misc/python/materialize/workload_replay/executor.py:286–423  ·  view source on GitHub ↗

Run a benchmark comparing two versions of Materialize.

(
    c: Composition,
    file: pathlib.Path,
    workload: dict,
    compare_against: str,
    factor_initial_data: float,
    factor_ingestions: float,
    factor_queries: float,
    runtime: int,
    verbose: bool,
    seed: str,
    early_initial_data: bool,
    max_concurrent_queries: int,
)

Source from the content-addressed store, hash-verified

284
285
286def benchmark(
287 c: Composition,
288 file: pathlib.Path,
289 workload: dict,
290 compare_against: str,
291 factor_initial_data: float,
292 factor_ingestions: float,
293 factor_queries: float,
294 runtime: int,
295 verbose: bool,
296 seed: str,
297 early_initial_data: bool,
298 max_concurrent_queries: int,
299) -> None:
300 """Run a benchmark comparing two versions of Materialize."""
301 import random
302
303 services = [
304 "materialized",
305 "postgres",
306 "mysql",
307 "sql-server",
308 "kafka",
309 "schema-registry",
310 "ssh-bastion-host",
311 "testdrive",
312 ]
313
314 # When scale_data is false, use 100% initial data
315 settings = workload.get("settings", {})
316 if not settings.get("scale_data", True):
317 factor_initial_data = 1.0
318
319 print_workload_stats(file, workload)
320
321 tag = resolve_tag(compare_against)
322 print(f"-- Running against materialized:{tag} (reference)")
323 random.seed(seed)
324 with c.override(
325 Materialized(
326 image=f"{image_registry()}/materialized:{tag}",
327 cluster_replica_size=cluster_replica_sizes,
328 ports=[6875, 6874, 6876, 6877, 6878, 6880, 6881, 26257],
329 environment_extra=["MZ_NO_BUILTIN_CONSOLE=0"],
330 additional_system_parameter_defaults={"enable_rbac_checks": "false"},
331 )
332 ):
333 stats_old = test(
334 c,
335 workload,
336 file,
337 factor_initial_data,
338 factor_ingestions,
339 factor_queries,
340 runtime,
341 verbose,
342 True,
343 True,

Callers 1

workflow_benchmarkFunction · 0.90

Calls 15

print_workload_statsFunction · 0.90
resolve_tagFunction · 0.90
MaterializedClass · 0.90
image_registryFunction · 0.90
compare_tableFunction · 0.90
TestFailureDetailsClass · 0.90
seedMethod · 0.80
overrideMethod · 0.80
query_mz_versionMethod · 0.80
killMethod · 0.80

Tested by

no test coverage detected