module StatsD::Instrument::StrictMetaprogramming

Public Instance Methods

statsd_count(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil) click to toggle source
Calls superclass method
# File lib/statsd/instrument/strict.rb, line 123
def statsd_count(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil)
  check_method_and_metric_name(method, name)
  super
end
statsd_count_if(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil) click to toggle source
Calls superclass method
# File lib/statsd/instrument/strict.rb, line 118
def statsd_count_if(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil)
  check_method_and_metric_name(method, name)
  super
end
statsd_count_success(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil) click to toggle source
Calls superclass method
# File lib/statsd/instrument/strict.rb, line 113
def statsd_count_success(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil)
  check_method_and_metric_name(method, name)
  super
end
statsd_distribution(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil) click to toggle source
Calls superclass method
# File lib/statsd/instrument/strict.rb, line 108
def statsd_distribution(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil)
  check_method_and_metric_name(method, name)
  super
end
statsd_measure(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil) click to toggle source
Calls superclass method
# File lib/statsd/instrument/strict.rb, line 103
def statsd_measure(method, name, sample_rate: nil, tags: nil, no_prefix: false, client: nil)
  check_method_and_metric_name(method, name)
  super
end

Private Instance Methods

check_method_and_metric_name(method, metric_name) click to toggle source
# File lib/statsd/instrument/strict.rb, line 130
def check_method_and_metric_name(method, metric_name)
  unless method.is_a?(Symbol)
    raise ArgumentError, "The method name should be provided as symbol, got #{method.inspect}"
  end

  unless metric_name.is_a?(String) || metric_name.is_a?(Proc)
    raise ArgumentError, "The metric name should be a proc or string, got #{metric_name.inspect}"
  end
end