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-9.16.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.16.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.8 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.7 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.6 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.5 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.4 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.3 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.15.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.6 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.5 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.4 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.3 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.14.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.13.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.13.0 lib/govuk_app_config/govuk_statsd.rb