Sha256: 21a930bfd7a9766db2476fba3911f2178400b14d4145c0ad51c95e1efd473e4f

Contents?: true

Size: 386 Bytes

Versions: 10

Compression:

Stored size: 386 Bytes

Contents

# Just a simple example that shows how the backoff policy works.
require 'bundler/setup'
require 'flipper/cloud/telemetry/backoff_policy'

intervals = []
policy = Flipper::Cloud::Telemetry::BackoffPolicy.new

10.times do |n|
  intervals << policy.next_interval
end

pp intervals.map { |i| i.round(2) }
puts "Total: #{intervals.sum.round(2)}ms (#{(intervals.sum/1_000.0).round(2)} sec)"

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
flipper-1.3.2 examples/cloud/backoff_policy.rb
flipper-1.3.1 examples/cloud/backoff_policy.rb
flipper-1.3.0 examples/cloud/backoff_policy.rb
flipper-1.3.0.pre examples/cloud/backoff_policy.rb
flipper-1.2.2 examples/cloud/backoff_policy.rb
flipper-1.2.1 examples/cloud/backoff_policy.rb
flipper-1.2.0 examples/cloud/backoff_policy.rb
flipper-1.1.2 examples/cloud/backoff_policy.rb
flipper-1.1.1 examples/cloud/backoff_policy.rb
flipper-1.1.0 examples/cloud/backoff_policy.rb