Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions rust_snuba/src/processors/eap_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ fn process_eap_item(msg: KafkaPayload, config: &ProcessorConfig) -> anyhow::Resu
TraceItemType::Unspecified => "null",
}
.to_string();

// Depending on retention days, a trace item is more expensive.
// The default retention is 30 days, a 90day retention for an
// item would effectively mean that we are storing 3 times the payload size
let retention_days_multiplier = eap_item.retention_days / 30;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is / with an int a quotient in rust?

if we ever had a 14d or 7d retention that would be a problem

let cogs_data = CogsData {
data: BTreeMap::from([(app_feature, payload.len() as u64)]),
data: BTreeMap::from([(
app_feature,
(retention_days_multiplier * payload.len()) as u64,
)]),
};

Ok(ProcessedItem {
Expand Down
Loading