Skip to content

Commit 366ba7c

Browse files
authored
Timeline file name timestamp in us (#15)
* file timestamp in us
1 parent 9a2beac commit 366ba7c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

smdebug/core/tfevent/timeline_file_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ def write_event(self, record):
329329
# write the trace event record
330330
position_and_length_of_record = self._writer.write(record.to_json() + ",\n")
331331
self.flush()
332-
self.last_event_end_time = int(round(end_time_for_event))
332+
self.last_event_end_time = int(round(record.event_end_ts_micros))
333333
return position_and_length_of_record
334334

335335
def flush(self):

tests/core/test_timeline_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def test_utc_timestamp(simple_profiler_config_parser, timezone, out_dir):
277277
file_timestamp = int(path[0].split("_")[0])
278278

279279
# file timestamp uses end of event
280-
assert (time_in_utc + 20) == file_timestamp
280+
assert (time_in_utc + 20) * CONVERT_TO_MICROSECS == file_timestamp
281281

282282
start_time_since_epoch = 0
283283
idx = 0

0 commit comments

Comments
 (0)