| Crates.io | mzprof |
| lib.rs | mzprof |
| version | 0.2.1 |
| created_at | 2025-08-02 15:42:53.548582+00 |
| updated_at | 2025-08-22 14:48:27.534984+00 |
| description | A dataflow profiler for Materialize |
| homepage | |
| repository | https://github.com/teskje/mzprof |
| max_upload_size | |
| id | 1778940 |
| size | 115,509 |
A dataflow profiler for Materialize.
mzprof is a CLI tool that connects to any Materialize environment and subscribes to introspection relations to collect operator-level metrics about running dataflows.
It produces profiles in pprof format, which can be analyzed using any tool supporting that format.
To install the latest published version of mzprof run:
cargo install --locked mzprof
Alternatively, clone this repository and use cargo run and/or cargo build as usual.
To collect a profile you need to supply mzprof with the postgres:// URL of the target Materialize environment, as well as a cluster and replica name:
mzprof --sql-url postgres://jan@localhost:6875/materialize --cluster compute --replica r1 --profile time
This will collect a time profile over all dataflows on the target replica, with their elapsed times since they were installed.
You can instead collect a profile of live elapsed times by specifying a listen duration in seconds:
mzprof [...] --profile time --duration 10
To collect a heap size profile, specify the size profile type instead:
mzprof [...] --profile size
mzprof currently supports four profile types:
time: operator elapsed timessize: operator heap sizescapacity: operator heap capacitiesrecords: operator maintained record countsIt is possible to collect profiles for multiple types in a single mzprof invocation, by passing more than one profile type in --profile.
Note that different profile types capture different classes of metrics.
Specifically, time is a rate metric (measures events per time), whereas size, capacity, and records are level metrics (measure accumulated values).
Collecting a profile over a time period using --duration only makes sense for rate metrics.
A convenient way to view profiles created by mzprof is uploading them to https://pprof.me.
It renders them as flame graphs with a bunch of knobs to customize the presentation:
Group by dropdown.Filter menu to add a stack filter for the dataflow name.Preferences > Levels.