Skip to content

Commit

Permalink
rename retry_backoff_base to more descriptive retry_exponential_backo…
Browse files Browse the repository at this point in the history
…ff_base
  • Loading branch information
tagomoris committed May 24, 2016
1 parent ff4b64b commit 7adc9ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/fluent/plugin/output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ class Output < Base
### Periodic -> fixed :retry_wait
### Exponencial backoff: k is number of retry times
# c: constant factor, @retry_wait
# b: base factor, @retry_backoff_base
# b: base factor, @retry_exponential_backoff_base
# k: times
# total retry time: c + c * b^1 + (...) + c*b^k = c*b^(k+1) - 1
config_param :retry_wait, :time, default: 1, desc: 'Seconds to wait before next retry to flush, or constant factor of exponential backoff.'
config_param :retry_backoff_base, :float, default: 2, desc: 'The base number of exponencial backoff for retries.'
config_param :retry_exponential_backoff_base, :float, default: 2, desc: 'The base number of exponencial backoff for retries.'
config_param :retry_max_interval, :time, default: nil, desc: 'The maximum interval seconds for exponencial backoff between retries while failing.'

config_param :retry_randomize, :bool, default: true, desc: 'If true, output plugin will retry after randomized interval not to do burst retries.'
Expand Down Expand Up @@ -816,15 +816,15 @@ def retry_state(randomize)
if @secondary
retry_state_create(
:output_retries, @buffer_config.retry_type, @buffer_config.retry_wait, @buffer_config.retry_timeout,
forever: @buffer_config.retry_forever, max_steps: @buffer_config.retry_max_times, backoff_base: @buffer_config.retry_backoff_base,
forever: @buffer_config.retry_forever, max_steps: @buffer_config.retry_max_times, backoff_base: @buffer_config.retry_exponential_backoff_base,
max_interval: @buffer_config.retry_max_interval,
secondary: true, secondary_threshold: @buffer_config.retry_secondary_threshold,
randomize: randomize
)
else
retry_state_create(
:output_retries, @buffer_config.retry_type, @buffer_config.retry_wait, @buffer_config.retry_timeout,
forever: @buffer_config.retry_forever, max_steps: @buffer_config.retry_max_times, backoff_base: @buffer_config.retry_backoff_base,
forever: @buffer_config.retry_forever, max_steps: @buffer_config.retry_max_times, backoff_base: @buffer_config.retry_exponential_backoff_base,
max_interval: @buffer_config.retry_max_interval,
randomize: randomize
)
Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_output_as_buffered_retries.rb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_log_time(msg, logs)

assert_equal :exponential_backoff, @i.buffer_config.retry_type
assert_equal 1, @i.buffer_config.retry_wait
assert_equal 2.0, @i.buffer_config.retry_backoff_base
assert_equal 2.0, @i.buffer_config.retry_exponential_backoff_base
assert !@i.buffer_config.retry_randomize

now = Time.parse('2016-04-13 18:17:00 -0700')
Expand Down

0 comments on commit 7adc9ac

Please sign in to comment.