Sha256: b1768a577e5e0b0a5e76fdbaddd001b59c4d25fa336359c75ca389b01a40b118

Contents?: true

Size: 956 Bytes

Versions: 9

Compression:

Stored size: 956 Bytes

Contents

require 'honeybadger/instrumentation_helper'
require 'honeybadger/plugin'

module Honeybadger
  module Plugins
    module Autotuner
      Plugin.register :autotuner do
        requirement { config.load_plugin_insights?(:autotuner) && defined?(::Autotuner) }

        execution do
          singleton_class.include(Honeybadger::InstrumentationHelper)

          ::Autotuner.reporter = proc do |report|
            Honeybadger.event("report.autotuner", report: report.to_s)
          end

          ::Autotuner.metrics_reporter = proc do |metrics|
            if config.load_plugin_insights_events?(:autotuner)
              Honeybadger.event('stats.autotuner', metrics)
            end

            if config.load_plugin_insights_metrics?(:autotuner)
              metric_source 'autotuner'
              metrics.each do |key, val|
                gauge key, ->{ val }
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
honeybadger-5.27.0 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.26.4 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.26.3 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.26.2 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.26.1 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.26.0 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.25.0 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.24.0 lib/honeybadger/plugins/autotuner.rb
honeybadger-5.23.0 lib/honeybadger/plugins/autotuner.rb