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.5.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.4.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.3.0 lib/gitlab_exporter/ruby.rb
gitlab-exporter-11.2.0 lib/gitlab_exporter/ruby.rb