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-4.10.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.10.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.9.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.8.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.7.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.7.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.6.3 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.6.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.6.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.6.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.5.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.4.3 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.4.2 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.4.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.4.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.3.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.2.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.1.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.0.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-4.0.0 lib/govuk_app_config/govuk_statsd.rb