Class: Statsig::Diagnostics::Tracker

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

Instance Method Summary collapse

Constructor Details

#initialize(diagnostics, context, key, step, tags = {}) ⇒ Tracker

Returns a new instance of Tracker.



69
70
71
72
73
74
75
# File 'lib/diagnostics.rb', line 69

def initialize(diagnostics, context, key, step, tags = {})
  @diagnostics = diagnostics
  @context = context
  @key = key
  @step = step
  @tags = tags
end

Instance Method Details

#end(**tags) ⇒ Object



81
82
83
# File 'lib/diagnostics.rb', line 81

def end(**tags)
  @diagnostics.mark(@key, 'end', @step, tags.nil? ? {} : tags.merge(@tags), @context)
end

#start(**tags) ⇒ Object



77
78
79
# File 'lib/diagnostics.rb', line 77

def start(**tags)
  @diagnostics.mark(@key, 'start', @step, tags.nil? ? {} : tags.merge(@tags), @context)
end