@@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS trigger_dev.queue_metrics_raw_v1
1313 environment_id String CODEC(ZSTD(1 )),
1414 queue_name String CODEC(ZSTD(1 )),
1515 event_time DateTime CODEC(Delta(4 ), ZSTD(1 )),
16- order_key UInt64 DEFAULT 0 , -- stream-id composite (ms*1e5+seq); deltaSumTimestamp ordering key
16+ order_key UInt64 DEFAULT 0 , -- stream-id composite (ms*1e5+seq), deltaSumTimestamp ordering key
1717 op LowCardinality(String), -- gauge | enqueue | started | ack | nack | dlq
1818 running UInt32 DEFAULT 0 ,
1919 queued UInt32 DEFAULT 0 ,
@@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS trigger_dev.queue_metrics_raw_v1
2323 env_limit UInt32 DEFAULT 0 ,
2424 throttled UInt8 DEFAULT 0 , -- 1 on a gauge emission with running>=limit AND queued>0
2525 wait_ms UInt32 DEFAULT 0 , -- set on op='started' (scheduling delay)
26- cumulative UInt64 DEFAULT 0 -- monotonic per-(queue,op) odometer on a counter op; diffed at read time
26+ cumulative UInt64 DEFAULT 0 -- monotonic per-(queue,op) odometer on a counter op, diffed at read time
2727)
2828ENGINE = MergeTree()
2929PARTITION BY toDate(event_time)
@@ -40,7 +40,7 @@ CREATE TABLE IF NOT EXISTS trigger_dev.queue_metrics_v1
4040 queue_name String CODEC(ZSTD(1 )),
4141 bucket_start DateTime CODEC(Delta(4 ), ZSTD(1 )),
4242
43- -- Cumulative-counter deltas: each op maintains a monotonic odometer; deltaSumTimestamp
43+ -- Cumulative-counter deltas: each op maintains a monotonic odometer, and deltaSumTimestamp
4444 -- sums positive consecutive deltas (ignoring resets) ordered by event_time, so a lost
4545 -- reading self-heals (the next surviving reading restates the total). Read with
4646 -- deltaSumTimestampMerge(<col>), never sum().
0 commit comments