Module: LightStep

Extended by:
SingleForwardable
Defined in:
lib/lightstep.rb,
lib/lightstep/span.rb,
lib/lightstep/tracer.rb,
lib/lightstep/version.rb,
lib/lightstep/reporter.rb,
lib/lightstep/span_context.rb,
lib/lightstep/global_tracer.rb,
lib/lightstep/transport/nil.rb,
lib/lightstep/transport/base.rb,
lib/lightstep/transport/callback.rb,
lib/lightstep/transport/http_json.rb

Overview

LightStep Tracer

Defined Under Namespace

Modules: Transport Classes: Error, GlobalTracer, Reporter, Span, SpanContext, Tracer

Constant Summary collapse

VERSION =
'0.10.6'.freeze

Class Method Summary collapse

Class Method Details

.guidObject

Returns a random guid. Note: this intentionally does not use SecureRandom, which is slower and cryptographically secure randomness is not required here.



28
29
30
31
32
33
34
# File 'lib/lightstep.rb', line 28

def self.guid
  unless @_lastpid == Process.pid
    @_lastpid = Process.pid
    @_rng = Random.new
  end
  @_rng.bytes(8).unpack('H*')[0]
end

.instanceObject

Returns the singleton instance of the Tracer.



11
12
13
# File 'lib/lightstep.rb', line 11

def self.instance
  LightStep::GlobalTracer.instance
end

.micros(time) ⇒ Object

Convert a time to microseconds



22
23
24
# File 'lib/lightstep.rb', line 22

def self.micros(time)
  (time.to_f * 1E6).floor
end