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-15.0.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-14.5.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-14.4.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-14.3.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-14.2.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-14.1.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-14.0.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.5.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.4.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.4.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.3.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.3.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.2.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.1.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.0.3 lib/gitlab_exporter/ruby.rb
gitlab-exporter-13.0.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-12.1.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-12.1.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-12.0.1 lib/gitlab_exporter/ruby.rb
gitlab-exporter-12.0.0 lib/gitlab_exporter/ruby.rb