logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

statsd.rb (460B)


  1. # frozen_string_literal: true
  2. if ENV['STATSD_ADDR'].present?
  3. host, port = ENV['STATSD_ADDR'].split(':')
  4. statsd = ::Statsd.new(host, port)
  5. statsd.namespace = ENV.fetch('STATSD_NAMESPACE') { ['Mastodon', Rails.env].join('.') }
  6. ::NSA.inform_statsd(statsd) do |informant|
  7. informant.collect(:action_controller, :web)
  8. informant.collect(:active_record, :db)
  9. informant.collect(:cache, :cache)
  10. informant.collect(:sidekiq, :sidekiq)
  11. end
  12. end