Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add limit of receipts per rav request #159

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions tap-agent/src/agent/sender_allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ impl SenderAllocationState {
.tap_manager
.create_rav_request(
self.config.tap.rav_request_timestamp_buffer_ms * 1_000_000,
// TODO: limit the number of receipts to aggregate per request.
None,
Some(self.config.tap.rav_request_receipt_limit),
)
.await
.map_err(|e| match e {
Expand Down Expand Up @@ -628,6 +627,7 @@ mod tests {
rav_request_trigger_value: 100,
rav_request_timestamp_buffer_ms: 1,
rav_request_timeout_secs: 5,
rav_request_receipt_limit: 1000,
..Default::default()
},
..Default::default()
Expand Down
9 changes: 9 additions & 0 deletions tap-agent/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,15 @@ pub struct Tap {
help = "YAML file with a map of sender addresses to aggregator endpoints."
)]
pub sender_aggregator_endpoints_file: PathBuf,

#[clap(
long,
value_name = "rav-request-receipt-limit",
env = "RAV_REQUEST_RECEIPT_LIMIT",
help = "Maximum number of receipts per aggregation request",
default_value_t = 10000
)]
pub rav_request_receipt_limit: u64,
}

/// Sets up tracing, allows log level to be set from the environment variables
Expand Down
Loading