Class: Oboe_metal::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/heroku_metal.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.layer_opObject

Returns the value of attribute layer_op.



13
14
15
# File 'lib/heroku_metal.rb', line 13

def layer_op
  @layer_op
end

Class Method Details

.log(layer, label, options = {}, with_backtrace = true) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/heroku_metal.rb', line 15

def log(layer, label, options = {}, with_backtrace = true)
  Oboe.logger.debug "HerokuMetal log: layer: #{layer}, label: #{label}, options: #{options}, with_backtrace: #{with_backtrace.to_s}"

  evt = Oboe::Context.createEvent()
  evt.addInfo("Layer", layer.to_s)
  evt.addInfo("Label", label.to_s)

  options.each_pair do |k, v|
    evt.addInfo(k.to_s, v.to_s)
  end

  evt.addInfo("Backtrace", Oboe::API.backtrace) if with_backtrace
  Oboe.reporter.sendReport(evt)
end

.tracing_layer_op?(operation) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
33
34
35
36
# File 'lib/heroku_metal.rb', line 30

def tracing_layer_op?(operation)
  if operation.is_a?(Array)
    return operation.include?(@layer_op)
  else
    return @layer_op == operation
  end
end