Type Alias mz_storage::statistics::SourceStatistics
source · pub type SourceStatistics = StorageStatistics<SourceStatisticsRecord, SourceStatisticsMetrics, SourceStatisticsMetadata>;
Expand description
Statistics maintained for sources.
Aliased Type§
struct SourceStatistics {
stats: Rc<RefCell<StatsInner<SourceStatisticsRecord, SourceStatisticsMetrics>>>,
meta: SourceStatisticsMetadata,
}
Fields§
§stats: Rc<RefCell<StatsInner<SourceStatisticsRecord, SourceStatisticsMetrics>>>
§meta: SourceStatisticsMetadata
Meta data needed to maintain statistics.
Implementations§
source§impl SourceStatistics
impl SourceStatistics
pub(crate) fn new( id: GlobalId, worker_id: usize, metrics: &SourceStatisticsMetricDefs, parent_source_id: GlobalId, shard_id: &ShardId, envelope: SourceEnvelope, resume_upper: Antichain<Timestamp>, ) -> Self
sourcepub fn clear(&self)
pub fn clear(&self)
Clear the data, resetting gauges to uninitialized. This does not reset prometheus gauges, which will be overwritten with new values.
sourcepub fn snapshot(&self) -> Option<SourceStatisticsRecord>
pub fn snapshot(&self) -> Option<SourceStatisticsRecord>
Get a snapshot of the data, returning None
if all gauges are not initialized.
This also resets counters, so that we continue to move diffs around.
sourcepub fn initialize_snapshot_committed(&self, upper: &Antichain<Timestamp>)
pub fn initialize_snapshot_committed(&self, upper: &Antichain<Timestamp>)
Set the snapshot_committed
stat based on the reported upper, and
mark the stats as initialized.
- In sql, we ensure that we never reset
snapshot_committed
tofalse
, but gauges and counters are ordinarily reset to 0 in Prometheus, so on restarts this value may be inconsistent.
sourcepub fn update_snapshot_committed(&self, upper: &Antichain<Timestamp>)
pub fn update_snapshot_committed(&self, upper: &Antichain<Timestamp>)
Set the snapshot_committed
stat based on the reported upper.
sourcepub fn inc_messages_received_by(&self, value: u64)
pub fn inc_messages_received_by(&self, value: u64)
Increment the messages_received
stat.
sourcepub fn inc_updates_staged_by(&self, value: u64)
pub fn inc_updates_staged_by(&self, value: u64)
Increment the updates
stat.
sourcepub fn inc_updates_committed_by(&self, value: u64)
pub fn inc_updates_committed_by(&self, value: u64)
Increment the messages_committed
stat.
sourcepub fn inc_bytes_received_by(&self, value: u64)
pub fn inc_bytes_received_by(&self, value: u64)
Increment the bytes_received
stat.
sourcepub fn update_bytes_indexed_by(&self, value: i64)
pub fn update_bytes_indexed_by(&self, value: i64)
Update the bytes_indexed
stat.
A positive value will add and a negative value will subtract.
sourcepub fn set_bytes_indexed(&self, value: i64)
pub fn set_bytes_indexed(&self, value: i64)
Set the bytes_indexed
to the given value
sourcepub fn update_records_indexed_by(&self, value: i64)
pub fn update_records_indexed_by(&self, value: i64)
Update the records_indexed
stat.
A positive value will add and a negative value will subtract.
sourcepub fn set_records_indexed(&self, value: i64)
pub fn set_records_indexed(&self, value: i64)
Set the records_indexed
to the given value
sourcepub fn initialize_rehydration_latency_ms(&self)
pub fn initialize_rehydration_latency_ms(&self)
Initialize the rehydration_latency_ms
stat as NULL
.
sourcepub fn update_envelope_state_tombstones_by(&self, value: i64)
pub fn update_envelope_state_tombstones_by(&self, value: i64)
Update the envelope_state_tombstones
stat.
A positive value will add and a negative value will subtract.
sourcepub fn update_rehydration_latency_ms(&self, upper: &Antichain<Timestamp>)
pub fn update_rehydration_latency_ms(&self, upper: &Antichain<Timestamp>)
Set the rehydration_latency_ms
stat based on the reported upper.
sourcepub fn set_offset_known(&self, value: u64)
pub fn set_offset_known(&self, value: u64)
Set the offset_known
stat to the given value.
sourcepub fn set_offset_committed(&self, value: u64)
pub fn set_offset_committed(&self, value: u64)
Set the offset_committed
stat to the given value.
sourcepub fn set_snapshot_records_known(&self, value: u64)
pub fn set_snapshot_records_known(&self, value: u64)
Set the snapshot_records_known
stat to the given value.
sourcepub fn set_snapshot_records_staged(&self, value: u64)
pub fn set_snapshot_records_staged(&self, value: u64)
Set the snapshot_records_known
stat to the given value.