@@ -51,7 +51,7 @@ class EventTraceRecorderImpl : public EventTraceRecorderObj {
51
51
void AddEvent (const Array<String>& request_ids, const std::string& event) final {
52
52
double event_time = std::chrono::duration_cast<std::chrono::duration<double >>(
53
53
std::chrono::system_clock::now ().time_since_epoch ())
54
- .count ();
54
+ .count (); // in seconds
55
55
56
56
{
57
57
std::lock_guard<std::mutex> lock (mutex_);
@@ -96,16 +96,16 @@ class EventTraceRecorderImpl : public EventTraceRecorderObj {
96
96
name = event;
97
97
phase = " i" ;
98
98
}
99
- int64_t event_time_in_ms = static_cast <int64_t >(event_time * 1e6 );
99
+ int64_t event_time_in_us = static_cast <int64_t >(event_time * 1e6 );
100
100
101
101
picojson::object event_json;
102
102
event_json[" name" ] = picojson::value (name);
103
103
event_json[" ph" ] = picojson::value (phase);
104
- event_json[" ts" ] = picojson::value (event_time_in_ms );
104
+ event_json[" ts" ] = picojson::value (event_time_in_us );
105
105
event_json[" pid" ] = picojson::value (static_cast <int64_t >(1 ));
106
106
event_json[" tid" ] = picojson::value (request_id);
107
107
108
- events_to_sort.push_back ({event_time_in_ms , picojson::value (event_json)});
108
+ events_to_sort.push_back ({event_time_in_us , picojson::value (event_json)});
109
109
}
110
110
std::sort (events_to_sort.begin (), events_to_sort.end (), fcmp_events);
111
111
for (auto [timestamp, event] : events_to_sort) {
0 commit comments