diff options
author | ulfjack <ulfjack@google.com> | 2018-06-12 07:38:51 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-06-12 07:40:05 -0700 |
commit | 21d60de9af1770b6ef08702d5dc9e23ed928df10 (patch) | |
tree | 28b640381cdb05afbf1fce6c4d14f948e1a29837 /src/main/java/com/google/devtools/build/lib/profiler/statistics | |
parent | 71404a77556d564beddc8ec53c17ddbf6c8b8ab5 (diff) |
Refactor profiler
- move the save method to an inner class
- don't use a timer, use a blocking queue instead
- add a format enum (in anticipation of adding a json output format)
- update the test to use an in memory buffer, and avoid FoundationTestCase
Compared to the original https://github.com/bazelbuild/bazel/commit/15b8c259db111012b4642287172cb4d1d82151f3, it contains these changes:
- Make it so we don't create a queue if we are not going to write any
data! The queue is now owned by the writer, and if there is no writer, there
is no queue.
This was causing a memory regression because slowest task profiling is
enabled by default, in which case the profiler is started with no output
file. In that case, there's no thread that is emptying the queue, but the
queue was still created by default.
- add additional tests for slowest task and histogram handling; these also
provide coverage for the case where the profiler is started without an output
stream
- move all the writer thread handling into the inner class
- make writer access thread-safe
- add a bunch of documentation
PiperOrigin-RevId: 200212978
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/profiler/statistics')
0 files changed, 0 insertions, 0 deletions