Class: SidekiqTamer::Mongo::Configuration
- Inherits:
-
Object
- Object
- SidekiqTamer::Mongo::Configuration
- Defined in:
- lib/sidekiq_tamer/mongo/configuration.rb
Constant Summary collapse
- MIN_TICKET_THRESHOLD =
80
Class Method Summary collapse
- .clear ⇒ Object
- .password ⇒ Object
- .setup(user:, password:, ticket_threshold: MIN_TICKET_THRESHOLD) ⇒ Object
- .ticket_threshold ⇒ Object
- .user ⇒ Object
Class Method Details
.clear ⇒ Object
12 13 14 15 |
# File 'lib/sidekiq_tamer/mongo/configuration.rb', line 12 def clear() ::Mongo::Monitoring::Global.unsubscribe(::Mongo::Monitoring::COMMAND, self) @options = {} end |
.password ⇒ Object
21 22 23 |
# File 'lib/sidekiq_tamer/mongo/configuration.rb', line 21 def password get_option_value(:password) end |
.setup(user:, password:, ticket_threshold: MIN_TICKET_THRESHOLD) ⇒ Object
6 7 8 9 10 |
# File 'lib/sidekiq_tamer/mongo/configuration.rb', line 6 def setup(user:, password:, ticket_threshold: MIN_TICKET_THRESHOLD) @options = { user: user, password: password, ticket_threshold: ticket_threshold } subscriber = SidekiqTamer::Mongo::CommandSubscriber.new ::Mongo::Monitoring::Global.subscribe(::Mongo::Monitoring::COMMAND, subscriber) end |
.ticket_threshold ⇒ Object
25 26 27 |
# File 'lib/sidekiq_tamer/mongo/configuration.rb', line 25 def ticket_threshold get_option_value(:ticket_threshold) end |
.user ⇒ Object
17 18 19 |
# File 'lib/sidekiq_tamer/mongo/configuration.rb', line 17 def user get_option_value(:user) end |