Class: GitLab::Exporter::CLI::GitProcess
- Inherits:
-
Object
- Object
- GitLab::Exporter::CLI::GitProcess
- Defined in:
- lib/gitlab_exporter/cli.rb
Overview
Process runner
Takes a pid and name for metrics
Constant Summary collapse
- COMMAND_NAME =
"git-process".freeze
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize(args) ⇒ GitProcess
constructor
A new instance of GitProcess.
- #options(args) ⇒ Object
- #run ⇒ Object
Constructor Details
#initialize(args) ⇒ GitProcess
Returns a new instance of GitProcess.
342 343 344 345 346 347 348 |
# File 'lib/gitlab_exporter/cli.rb', line 342 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
359 360 361 |
# File 'lib/gitlab_exporter/cli.rb', line 359 def help @options.help end |
#options(args) ⇒ Object
350 351 352 353 354 355 356 357 |
# File 'lib/gitlab_exporter/cli.rb', line 350 def (args) args. do |opts| opts. = "Usage: #{EXECUTABLE_NAME} #{COMMAND_NAME} [options]" opts.on("--quantiles", "Return quantiles instead of exact metrics") do @quantiles = true end end end |
#run ⇒ Object
363 364 365 366 367 |
# File 'lib/gitlab_exporter/cli.rb', line 363 def run ::GitLab::Exporter::GitProcessProber.new(quantiles: @quantiles) .probe_git .write_to(@target) end |