1111from splitio .models .events import Event , EventWrapper
1212from splitio .models .telemetry import get_latency_bucket_index
1313from splitio .client import input_validator
14+ from splitio .util import utctime_ms
1415
1516
1617class Client (object ): # pylint: disable=too-many-instance-attributes
@@ -115,7 +116,7 @@ def _make_evaluation(self, key, feature, attributes, method_name, metric_name):
115116 result ['impression' ]['label' ],
116117 result ['impression' ]['change_number' ],
117118 bucketing_key ,
118- start
119+ utctime_ms (),
119120 )
120121
121122 self ._record_stats ([(impression , attributes )], start , metric_name )
@@ -131,7 +132,7 @@ def _make_evaluation(self, key, feature, attributes, method_name, metric_name):
131132 Label .EXCEPTION ,
132133 self ._split_storage .get_change_number (),
133134 bucketing_key ,
134- start
135+ utctime_ms (),
135136 )
136137 self ._record_stats ([(impression , attributes )], start , metric_name )
137138 except Exception : # pylint: disable=broad-except
@@ -178,7 +179,7 @@ def _make_evaluations(self, key, features, attributes, method_name, metric_name)
178179 result ['impression' ]['label' ],
179180 result ['impression' ]['change_number' ],
180181 bucketing_key ,
181- start )
182+ utctime_ms () )
182183
183184 bulk_impressions .append (impression )
184185 treatments [feature ] = (result ['treatment' ], result ['configurations' ])
@@ -389,7 +390,7 @@ def track(self, key, traffic_type, event_type, value=None, properties=None):
389390 traffic_type_name = traffic_type ,
390391 event_type_id = event_type ,
391392 value = value ,
392- timestamp = int ( time . time () * 1000 ),
393+ timestamp = utctime_ms ( ),
393394 properties = properties ,
394395 )
395396 return self ._events_storage .put ([EventWrapper (
0 commit comments