lib/determinator/tracking/tracker.rb in determinator-2.4.0 vs lib/determinator/tracking/tracker.rb in determinator-2.4.2
- old
+ new
@@ -7,11 +7,12 @@
attr_reader :type, :determinations
def initialize(type)
@determinations = []
@type = type
- @start = now
+ @monotonic_start = now
+ @start = Time.now
end
def track(id, guid, feature, determination)
determinations << Determinator::Tracking::Determination.new(
id: id,
@@ -19,14 +20,16 @@
feature_id: feature.identifier,
determination: determination
)
end
- def finish!(error:, **attributes)
- request_time = now - @start
+ def finish!(endpoint:, error:, **attributes)
+ request_time = now - @monotonic_start
Determinator::Tracking::Request.new(
+ start: @start,
type: type,
time: request_time,
+ endpoint: endpoint,
error: error,
attributes: attributes,
determinations: determinations,
context: Determinator::Tracking.context
)