pub struct InventoryRecord {
pub shared_resource_id: String,
pub app_feature: String,
pub op_type: OpType,
pub record_id: String,
pub timestamp: i64,
pub sample_rate: f64,
pub size: Option<u64>,
pub expiration_time: Option<i64>,
pub organization_id: Option<u64>,
pub project_id: Option<u64>,
}Expand description
A single inventory change event.
Construct these through InventoryTracker rather than
directly.
Fields§
Identifies the shared resource this record belongs to.
This is meant to match a label on a provisioned storage backend so that downstream consumers can join the change stream dataset with, for instance, billing info.
app_feature: StringThe product feature this record is attributed to.
op_type: OpTypeThe type of operation that occurred.
record_id: StringOpaque stable identifier, unique within shared_resource_id.
A hash of the caller’s storage key, derived by
InventoryTracker. The raw key is never emitted.
timestamp: i64When the operation occurred, as Unix epoch microseconds.
sample_rate: f64Fraction of records the producer is emitting for this resource, in [0, 1].
InventoryTracker will not emit messages for records that are sampled out so the
consumer doesn’t need to do any filtering. The reason the sample rate is included
on messages is so that the consumer or downstream pipelines can apply a
1 / sample_rate weight when calculating aggregates to account for changes to the
sample rate.
size: Option<u64>Stored size in bytes. Always set for OpType::Write.
expiration_time: Option<i64>When this record is set to expire, in Unix epoch microseconds if known.
organization_id: Option<u64>ID of the organization that owns the record, if known.
project_id: Option<u64>ID of the project that owns the record, if known.
Trait Implementations§
Source§impl Clone for InventoryRecord
impl Clone for InventoryRecord
Source§fn clone(&self) -> InventoryRecord
fn clone(&self) -> InventoryRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more