Sha256: 861f941ecbff03fee9cd853a95bcb65e53caef5ac81db3f6f91b5398b9e698c4

Contents?: true

Size: 469 Bytes

Versions: 95

Compression:

Stored size: 469 Bytes

Contents

require "statsd"
require "forwardable"

module GovukStatsd
  extend SingleForwardable
  def_delegators :client, :increment, :decrement, :count, :time, :timing,
                 :gauge, :set, :batch

  def self.client
    @client ||= begin
      statsd_client = ::Statsd.new(ENV["GOVUK_STATSD_HOST"] || "localhost", 8125, ENV["GOVUK_STATSD_PROTOCOL"]&.to_sym || :udp)
      statsd_client.namespace = ENV["GOVUK_STATSD_PREFIX"].to_s
      statsd_client
    end
  end
end

Version data entries

95 entries across 95 versions & 1 rubygems

Version Path
govuk_app_config-3.3.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-3.2.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.0.0.pre.4 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.0.0.pre.3 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.0.0.pre.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.0.0.pre.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-3.1.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-3.1.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-3.0.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-2.10.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-2.9.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-2.9.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-2.8.4 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-2.8.3 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-2.8.2 lib/govuk_app_config/govuk_statsd.rb