module LightStep
frozen_string_literal: true
frozen_string_literal: true
Constants
- VERSION
Public Class Methods
guid()
click to toggle source
Returns a random guid. Note: this intentionally does not use SecureRandom, which is slower and cryptographically secure randomness is not required here.
# File lib/lightstep.rb, line 31 def self.guid unless @_lastpid == Process.pid @_lastpid = Process.pid @_rng = Random.new end @_rng.bytes(8).unpack('H*')[0] end
instance()
click to toggle source
Returns the singleton instance of the Tracer
.
# File lib/lightstep.rb, line 12 def self.instance LightStep::GlobalTracer.instance end
logger()
click to toggle source
# File lib/lightstep.rb, line 39 def self.logger @logger ||= defined?(::Rails) ? Rails.logger : Logger.new(STDOUT) end
logger=(logger)
click to toggle source
# File lib/lightstep.rb, line 43 def self.logger=(logger) @logger = logger end
micros(time)
click to toggle source
Convert a time to microseconds
# File lib/lightstep.rb, line 25 def self.micros(time) (time.to_f * 1E6).floor end