Class: GitLab::Exporter::RubyProber
- Inherits:
-
Object
- Object
- GitLab::Exporter::RubyProber
- 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
-
#initialize(metrics: PrometheusMetrics.new, quantiles: false, **opts) ⇒ RubyProber
constructor
rubocop:disable Lint/UnusedMethodArgument.
- #probe_gc ⇒ Object
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_gc ⇒ Object
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 |