Class: Skylight::Core::Instrumenter::TraceInfo Private

Inherits:
Object
  • Object
show all
Defined in:
lib/skylight/core/instrumenter.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(key = KEY) ⇒ TraceInfo

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of TraceInfo.


14
15
16
17
# File 'lib/skylight/core/instrumenter.rb', line 14

def initialize(key = KEY)
  @key = key
  @muted_key = "#{key}_muted"
end

Instance Method Details

#currentObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


19
20
21
# File 'lib/skylight/core/instrumenter.rb', line 19

def current
  Thread.current[@key]
end

#current=(trace) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


23
24
25
# File 'lib/skylight/core/instrumenter.rb', line 23

def current=(trace)
  Thread.current[@key] = trace
end

#muted=(val) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

NOTE: This should only be set by the instrumenter, and only in the context of a `mute` block. Do not try to turn this flag on and off directly.


30
31
32
# File 'lib/skylight/core/instrumenter.rb', line 30

def muted=(val)
  Thread.current[@muted_key] = val
end

#muted?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

34
35
36
# File 'lib/skylight/core/instrumenter.rb', line 34

def muted?
  !!Thread.current[@muted_key]
end