Sha256: 25c55e3339348fd10239031f634ff5bf9d271995d25d277ed84bd4f5ffe50259

Contents?: true

Size: 541 Bytes

Versions: 44

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

module GitLab
  module Exporter
    # Probes a current process GC for info then writes metrics to a target
    class RubyProber
      def initialize(metrics: PrometheusMetrics.new, quantiles: false, **opts) # rubocop:disable Lint/UnusedMethodArgument
        @metrics = metrics
        @use_quantiles = quantiles
      end

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

        self
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
gitlab-exporter-11.19.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.18.2 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.18.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.18.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.17.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.17.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.16.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.15.2 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.15.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.15.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.14.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.13.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.13.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.12.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.11.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.10.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.9.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.8.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.7.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.6.0 lib/gitlab_exporter/ruby.rb