Class: Lhm::Throttler::ReplicaLag
- Inherits:
-
Object
- Object
- Lhm::Throttler::ReplicaLag
- Includes:
- Command
- 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
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 Command
Constructor Details
#initialize(options = {}) ⇒ ReplicaLag
Returns a new instance of ReplicaLag.
25 26 27 28 29 30 31 32 |
# File 'lib/lhm/throttler/replica_lag.rb', line 25 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] end |
Instance Attribute Details
#allowed_lag ⇒ Object
Returns the value of attribute allowed_lag.
23 24 25 |
# File 'lib/lhm/throttler/replica_lag.rb', line 23 def allowed_lag @allowed_lag end |
#connection ⇒ Object
Returns the value of attribute connection.
23 24 25 |
# File 'lib/lhm/throttler/replica_lag.rb', line 23 def connection @connection end |
#stride ⇒ Object
Returns the value of attribute stride.
23 24 25 |
# File 'lib/lhm/throttler/replica_lag.rb', line 23 def stride @stride end |
#timeout_seconds ⇒ Object
Returns the value of attribute timeout_seconds.
23 24 25 |
# File 'lib/lhm/throttler/replica_lag.rb', line 23 def timeout_seconds @timeout_seconds end |
Instance Method Details
#execute ⇒ Object
34 35 36 |
# File 'lib/lhm/throttler/replica_lag.rb', line 34 def execute sleep(throttle_seconds) end |