Skip to content

Commit 995e817

Browse files
committed
Fixed outcome config naming
1 parent c5885c4 commit 995e817

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

relay-config/src/config.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -715,18 +715,18 @@ pub struct Outcomes {
715715
pub emit_outcomes: bool,
716716
/// The maximum number of outcomes that are batched before being sent
717717
/// via http to the upstream (only applies to non processing relays)
718-
pub max_outcome_batch_size: usize,
718+
pub max_batch_size: usize,
719719
/// The maximum time interval (in milliseconds) that an outcome may be batched
720720
/// via http to the upstream (only applies to non processing relays)
721-
pub max_outcome_interval_millsec: u64,
721+
pub max_interval: u64,
722722
}
723723

724724
impl Default for Outcomes {
725725
fn default() -> Self {
726726
Outcomes {
727727
emit_outcomes: false,
728-
max_outcome_batch_size: 1000,
729-
max_outcome_interval_millsec: 500,
728+
max_batch_size: 1000,
729+
max_interval: 500,
730730
}
731731
}
732732
}
@@ -1072,12 +1072,12 @@ impl Config {
10721072

10731073
/// Returns the maximum number of outcomes that are batched before being sent
10741074
pub fn max_outcome_batch_size(&self) -> usize {
1075-
self.values.outcomes.max_outcome_batch_size
1075+
self.values.outcomes.max_batch_size
10761076
}
10771077

10781078
/// Returns the maximum interval that an outcome may be batched
10791079
pub fn max_outcome_interval(&self) -> Duration {
1080-
Duration::from_millis(self.values.outcomes.max_outcome_interval_millsec)
1080+
Duration::from_millis(self.values.outcomes.max_interval)
10811081
}
10821082

10831083
/// Returns the log level.

tests/integration/test_outcome.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def test_outcomes_non_processing(relay, relay_with_processing, mini_sentry):
8686
config = {
8787
"outcomes": {
8888
"emit_outcomes": True,
89-
"max_outcome_batch_size": 1,
90-
"max_outcome_interval_millsec": 1,
89+
"max_batch_size": 1,
90+
"max_interval": 1,
9191
}
9292
}
9393

@@ -130,8 +130,8 @@ def test_outcomes_not_sent_when_disabled(relay, mini_sentry):
130130
config = {
131131
"outcomes": {
132132
"emit_outcomes": False,
133-
"max_outcome_batch_size": 1,
134-
"max_outcome_interval_millsec": 1,
133+
"max_batch_size": 1,
134+
"max_interval": 1,
135135
}
136136
}
137137

@@ -157,8 +157,8 @@ def test_outcomes_non_processing_max_batch_time(relay, mini_sentry):
157157
config = {
158158
"outcomes": {
159159
"emit_outcomes": True,
160-
"max_outcome_batch_size": 1000, # a huge batch size
161-
"max_outcome_interval_millsec": 1, # very short batch time
160+
"max_batch_size": 1000, # a huge batch size
161+
"max_interval": 1, # very short batch time
162162
}
163163
}
164164
relay = relay(mini_sentry, config)
@@ -171,7 +171,7 @@ def test_outcomes_non_processing_max_batch_time(relay, mini_sentry):
171171
for i in range(events_to_send):
172172
event_id = _send_event(relay)
173173
event_ids.add(event_id)
174-
time.sleep(0.002) # sleep more than the batch time
174+
time.sleep(0.005) # sleep more than the batch time
175175

176176
# we should get one batch per event sent
177177
batches = []
@@ -196,8 +196,8 @@ def test_outcomes_non_processing_batching(relay, mini_sentry):
196196
config = {
197197
"outcomes": {
198198
"emit_outcomes": True,
199-
"max_outcome_batch_size": batch_size,
200-
"max_outcome_interval_millsec": HOUR_MILLISEC, # batch every hour
199+
"max_batch_size": batch_size,
200+
"max_interval": HOUR_MILLISEC, # batch every hour
201201
}
202202
}
203203

0 commit comments

Comments
 (0)