[Structured Metrics]: Add flocks when reading events.
This is needed to prevent Chromium from reading incomplete files before
the Chromium OS processes are done writing.
This CL also fixes the flaky test since it was failing for me locally. The test was flaky because file iteration was random and there were some combination of events that would change the expected result.
This CL also cleans up some old code that should have been removed a long time ago.
Bug: 40941078,309864573
Change-Id: I682704b54ce5331158509cbb7df70439636a578a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5466807
Reviewed-by: Andrew Bregger <andrewbregger@google.com>
Reviewed-by: Ian Barkley-Yeung <iby@chromium.org>
Commit-Queue: Jong Ahn <jongahn@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1291493}
NOKEYCHECK=True
GitOrigin-RevId: a9e8ac66fb4d0ced9ce73922162e9cf79641c0d5
5 files changed