Skip to content

Commit

Permalink
Events dump timings
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyzverev committed Sep 28, 2023
1 parent 6ee3872 commit d2cf824
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2501,3 +2501,4 @@ env/lib/python3.7/site-packages/zipp-3.15.0.dist-info/METADATA
env/lib/python3.7/site-packages/zipp-3.15.0.dist-info/RECORD
env/lib/python3.7/site-packages/zipp-3.15.0.dist-info/top_level.txt
env/lib/python3.7/site-packages/zipp-3.15.0.dist-info/WHEEL
.DS_Store
3 changes: 3 additions & 0 deletions recon_lw/EventsSaver.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ def flush(self):

def flush_scope(self, scope):
if scope in self._scopes_buffers:
ts_start = datetime.now().timestamp()
events = Data(self._scopes_buffers[scope])
events_file = Path(self._path) / (scope + "_scope_" + self._scopes_buffers[scope][0]["eventId"] + ".pickle")
events.build_cache(events_file)
self._scopes_buffers[scope].clear()
ts_end = datetime.now().timestamp()
print (datetime.now(), " Saved local events for ", scope, ", duration: ", ts_end - ts_start)

def save_events(self, batch):
for e in batch:
Expand Down

0 comments on commit d2cf824

Please sign in to comment.