Class: Statsig::Diagnostics::Tracker

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/diagnostics.rb

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Tracker.



101
102
103
104
105
106
107
# File 'lib/diagnostics.rb', line 101

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

Instance Method Details

#end(**tags) ⇒ Object



113
114
115
# File 'lib/diagnostics.rb', line 113

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

#start(**tags) ⇒ Object



109
110
111
# File 'lib/diagnostics.rb', line 109

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