Method: Wavefront::Validators#wf_ms_ts?

Defined in:
lib/wavefront-sdk/validators.rb

#wf_ms_ts?(timestamp) ⇒ Boolean

Ensure the given argument is a valid millisecond epoch timestamp. We do no checking of the value, because who am I to say that the user doesn’t want to send a point relating to 1ms after the epoch, or a thousand years in the future?

Parameters:

  • timestamp (Integer)

    the timestamp name to validate

Returns:

  • (Boolean)

    True if the value is valid

Raises:

  • Wavefront::Exception::InvalidTimestamp



112
113
114
115
116
# File 'lib/wavefront-sdk/validators.rb', line 112

def wf_ms_ts?(timestamp)
  return true if timestamp.is_a?(Numeric)

  raise Wavefront::Exception::InvalidTimestamp, timestamp
end