mz-benchmark

Add and debug Materialize performance benchmark scenarios across three testing frameworks.

6.4k|512|Updated Feb 22, 2019
One-click install
npx skills add https://github.com/MaterializeInc/materialize --skill mz-benchmark
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mz-benchmark
Source: https://github.com/MaterializeInc/materialize/tree/main/.agents/skills/mz-benchmark
Command: npx skills add https://github.com/MaterializeInc/materialize --skill mz-benchmark

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Materialize developers need to measure and prevent performance regressions, but the repository contains three distinct benchmark frameworks with different conventions, making it hard to know which one to use and how to write scenarios correctly.

Core Features & Use Cases

  • Feature Benchmark: Add micro-benchmark scenarios measuring wall-clock time of individual SQL operations using testdrive fragments with timing markers.
  • Scalability Test: Create workloads measuring TPS under increasing concurrency (1 to 256 clients) by extending marker classes like DmlDqlWorkload.
  • Parallel Benchmark: Define sustained-load scenarios measuring latency percentiles (p50/p95/p99) and QPS over time with open-loop and closed-loop actions.
  • Use Case: A developer optimizing a SELECT query adds a Feature Benchmark scenario with and markers, runs it via mzcompose, and sets a RELATIVE_THRESHOLD to catch regressions in CI.

Quick Start

Ask the assistant to add a new feature benchmark scenario that measures the latency of a specific SQL query in Materialize.

Frequently Asked Questions about mz-benchmark

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a performance benchmark scenario in Materialize?

Add a Python class extending Scenario in the feature_benchmark scenarios directory and implement a benchmark() method returning a Td fragment with and timing markers. Run it with bin/mzcompose --find feature-benchmark run default --root-scenario=YourScenario.

Which Materialize benchmark framework should I use?

Use Feature Benchmark for single-operation latency, Scalability Test for TPS under increasing client concurrency, and Parallel Benchmark for sustained latency distributions over time. The choice depends on whether you measure one query, throughput scaling, or degradation over a load period.

How do timing markers work in Materialize feature benchmarks?

The marker starts measurement after it completes, and ends measurement when it completes. For a single query, use a dummy SELECT 1 with so testdrive startup overhead is excluded from the measurement.

How do I set regression thresholds for parallel benchmark scenarios?

Use the guarantees dict for absolute limits like qps and p99 values, or regression_thresholds for relative limits versus a baseline, such as qps at 0.8 of baseline. Scenarios can also be disabled with the @disabled decorator.

What is the difference between open-loop and closed-loop load testing?

OpenLoop sends operations at a fixed rate regardless of latency using Periodic or Gaussian distributions, while ClosedLoop starts the next operation only after the previous one completes. Open-loop reveals queueing under load; closed-loop measures pure sequential latency.