Method: Wavefront::Validators#wf_metric_name?
- Defined in:
- lib/wavefront-sdk/validators.rb
#wf_metric_name?(metric) ⇒ Boolean
Ensure the given argument is a valid Wavefront metric name, or path.
is not valid.
49 50 51 52 53 54 55 56 57 |
# File 'lib/wavefront-sdk/validators.rb', line 49 def wf_metric_name?(metric) if metric.is_a?(String) && metric.size < 1024 && (metric.match(/^#{DELTA}?[\w\-.]+$/o) || metric.match(%r{^"#{DELTA}?[\w\-./,]+"$}o)) return true end raise Wavefront::Exception::InvalidMetricName, metric end |