class CustomNewRelicConfiguration

  # List all production hosts (FQDN) on which NewRelic should be enabled
  NEWRELIC_HOSTS = %w( server1.production.local server2.production.local )

  def self.enable_on_current_host?
    current_hostname = (`hostname -f`).strip
    Rails.logger.info ">>> Checking whether to enable NewRelic on host '#{current_hostname}'"

    unless NEWRELIC_HOSTS.include?(current_hostname)
      Rails.logger.info ">>> NewRelic is disabled on this host! Edit config/newrelic.yml to enable."
      return false
    else
      Rails.logger.info ">>> NewRelic should be enabled on this host."
      return true
    end
  end

end
