Class: GitLab::Exporter::RubyProber

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab_exporter/ruby.rb

Overview

Probes a current process GC for info then writes metrics to a target

Instance Method Summary collapse

Constructor Details

#initialize(metrics: PrometheusMetrics.new, quantiles: false, **opts) ⇒ RubyProber

rubocop:disable Lint/UnusedMethodArgument



7
8
9
10
# File 'lib/gitlab_exporter/ruby.rb', line 7

def initialize(metrics: PrometheusMetrics.new, quantiles: false, **opts) # rubocop:disable Lint/UnusedMethodArgument
  @metrics = metrics
  @use_quantiles = quantiles
end

Instance Method Details

#probe_gcObject



12
13
14
15
16
17
18
# File 'lib/gitlab_exporter/ruby.rb', line 12

def probe_gc
  GC.stat.each do |stat, value|
    @metrics.add("ruby_gc_stat_#{stat}", value.to_i, @use_quantiles)
  end

  self
end