Class: Lhm::Throttler::ReplicaLag
- Inherits:
-
Object
- Object
- Lhm::Throttler::ReplicaLag
- Includes:
- Command, BackoffReduction
- Defined in:
- lib/lhm/throttler/replica_lag.rb
Direct Known Subclasses
Constant Summary collapse
- INITIAL_TIMEOUT =
0.1
- DEFAULT_STRIDE =
2_000
- DEFAULT_MAX_ALLOWED_LAG =
10
- MAX_TIMEOUT =
INITIAL_TIMEOUT * 1024
Constants included from BackoffReduction
BackoffReduction::DEFAULT_BACKOFF_REDUCTION_FACTOR, BackoffReduction::MIN_STRIDE_SIZE
Instance Attribute Summary collapse
-
#allowed_lag ⇒ Object
Returns the value of attribute allowed_lag.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#stride ⇒ Object
Returns the value of attribute stride.
-
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ ReplicaLag
constructor
A new instance of ReplicaLag.
Methods included from BackoffReduction
Methods included from Command
Constructor Details
#initialize(options = {}) ⇒ ReplicaLag
Returns a new instance of ReplicaLag.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/lhm/throttler/replica_lag.rb', line 26 def initialize( = {}) @timeout_seconds = INITIAL_TIMEOUT @stride = [:stride] || DEFAULT_STRIDE @allowed_lag = [:allowed_lag] || DEFAULT_MAX_ALLOWED_LAG @replicas = {} @get_config = [:current_config] @check_only = [:check_only] super end |
Instance Attribute Details
#allowed_lag ⇒ Object
Returns the value of attribute allowed_lag.
24 25 26 |
# File 'lib/lhm/throttler/replica_lag.rb', line 24 def allowed_lag @allowed_lag end |
#connection ⇒ Object
Returns the value of attribute connection.
24 25 26 |
# File 'lib/lhm/throttler/replica_lag.rb', line 24 def connection @connection end |
#stride ⇒ Object
Returns the value of attribute stride.
24 25 26 |
# File 'lib/lhm/throttler/replica_lag.rb', line 24 def stride @stride end |
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
24 25 26 |
# File 'lib/lhm/throttler/replica_lag.rb', line 24 def timeout_seconds @timeout_seconds end |
Instance Method Details
#execute ⇒ Object
37 38 39 |
# File 'lib/lhm/throttler/replica_lag.rb', line 37 def execute sleep(throttle_seconds) end |