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.12.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.11.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.11.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.11.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.10.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.9.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.9.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.9.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.8.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.8.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.8.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.7.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.6.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.5.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.4.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.3.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.2.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.1.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.0.4 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-9.0.3 lib/govuk_app_config/govuk_statsd.rb