Merged
Conversation
Add a rolling rate tracker (3s window) that measures blocks/sec for each sink independently. Both PostgreSQL and ClickHouse writers now update the tracker on every block write. - Add SinkRateTracker to metrics.rs with update/get functions - Instrument PG writer with sink write duration/rows/rate metrics - Add rate field to StoreStatus (blocks/sec, optional) - Wire rates into /status API response and CLI display - Show rate inline: 'PostgreSQL (2500 blk/s)' when actively writing Amp-Thread-ID: https://ampcode.com/threads/T-019c928a-5ea3-72ac-9724-a96ae0d27fd1 Co-authored-by: Amp <amp@ampcode.com>
4760810 to
d040653
Compare
o-az
pushed a commit
that referenced
this pull request
Apr 27, 2026
Add a rolling rate tracker (3s window) that measures blocks/sec for each sink independently. Both PostgreSQL and ClickHouse writers now update the tracker on every block write. - Add SinkRateTracker to metrics.rs with update/get functions - Instrument PG writer with sink write duration/rows/rate metrics - Add rate field to StoreStatus (blocks/sec, optional) - Wire rates into /status API response and CLI display - Show rate inline: 'PostgreSQL (2500 blk/s)' when actively writing Amp-Thread-ID: https://ampcode.com/threads/T-019c928a-5ea3-72ac-9724-a96ae0d27fd1 Co-authored-by: Amp <amp@ampcode.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds per-sink write rate tracking (blocks/sec) so you can see how fast PostgreSQL and ClickHouse are each being populated.
Changes
metrics.rs— Rolling rate tracker (3s window) withupdate_sink_block_rate/get_sink_block_ratewriter.rs— Instrumented all 4 PG write functions with sink metrics (duration, rows, rate)ch_sink.rs— Added rate tracking to CH block writesservice/mod.rs— Addedrate: Option<f64>toStoreStatusapi/mod.rs— Populates rate in/statusresponse for both storescli/status.rs— Shows rate inline:PostgreSQL (2500 blk/s)in all display modesExample output