Class: GitLab::Exporter::CLI::SidekiqRunner
- Inherits:
-
Object
- Object
- GitLab::Exporter::CLI::SidekiqRunner
- Defined in:
- lib/gitlab_exporter/cli.rb
Overview
Sidekiq runner.
It will take a Redis connection URL and print results to STDOUT
Constant Summary collapse
- COMMAND_NAME =
"sidekiq".freeze
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(args) ⇒ SidekiqRunner
constructor
A new instance of SidekiqRunner.
- #options(args) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ SidekiqRunner
Returns a new instance of SidekiqRunner.
265 266 267 268 269 270 271 |
# File 'lib/gitlab_exporter/cli.rb', line 265 def initialize(args) @options = (args) @options.parse! @target = args.shift || STDOUT @target = File.open(@target, "a") if @target.is_a?(String) end |
Instance Method Details
#help ⇒ Object
282 283 284 |
# File 'lib/gitlab_exporter/cli.rb', line 282 def help @options.help end |
#options(args) ⇒ Object
273 274 275 276 277 278 279 280 |
# File 'lib/gitlab_exporter/cli.rb', line 273 def (args) args. do |opts| opts. = "Usage: #{EXECUTABLE_NAME} #{COMMAND_NAME} [options]" opts.on("--redis-url=\"redis://localhost:6379\"", "Redis URL") do |val| @redis_url = val end end end |
#run ⇒ Object
286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/gitlab_exporter/cli.rb', line 286 def run validate! ::GitLab::Exporter::SidekiqProber.new(redis_url: @redis_url) .probe_stats .probe_queues .probe_jobs_limit .probe_workers .probe_retries .write_to(@target) end |