Sha256: 59ac8980f413c01af3c8fd3ad9bcbcddf9af6bfe3b3f09ec2a60696df01d1f23

Contents?: true

Size: 383 Bytes

Versions: 4

Compression:

Stored size: 383 Bytes

Contents

require "statsd"
require "forwardable"

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

  def self.client
    @statsd_client ||= begin
      statsd_client = ::Statsd.new("localhost")
      statsd_client.namespace = ENV["GOVUK_STATSD_PREFIX"].to_s
      statsd_client
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
govuk_app_config-1.3.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-1.2.1 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-1.2.0 lib/govuk_app_config/govuk_statsd.rb
govuk_app_config-1.1.0 lib/govuk_app_config/govuk_statsd.rb