Sha256: 9da8f24086bf83d957b7712bfd9b3d6d318f35c10d4133bf50bb5d8e32ce5a08

Contents?: true

Size: 739 Bytes

Versions: 1

Compression:

Stored size: 739 Bytes

Contents

require 'hashie'
require 'dry-struct'
require 'host_status/types'
require 'host_status/application'

module HostStatus
  module NewRelic
    class APM < ::HostStatus::Application::Proxy
      DEFAULTS = {
          response_time:  nil,
          error_rate:     nil,
          instance_count: nil,
          apdex_score:    nil,
      }.freeze

      def transform_arguments(**opts)
        Hashie::Extensions::SymbolizeKeys.symbolize_keys!(opts)
        options                 = DEFAULTS.merge(opts)
        options[:latency_p50]   = options.delete(:response_time)
        options[:errors]        = options.delete(:error_rate)
        options[:process_count] = options.delete(:instance_count)
        options
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
host_status-0.1.0 lib/host_status/new_relic/apm.rb