Skip to content

Commit

Permalink
Add limit of receipts per rav request (#159)
Browse files Browse the repository at this point in the history
* feat: Add receipt limit

* fix: Give more accurate help for rav_request_receipt_limit
  • Loading branch information
carlosvdr authored May 3, 2024
1 parent 0a217f5 commit 1966049
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
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

0 comments on commit 1966049

Please sign in to comment.