Extract an interface from the perf results logger.

The new interface is called PerfTestResultWriter and is currently
implemented by PerfResultsLogger (renamed PerfTestGraphJsonWriter).

I plan to introduce a second implementation of the perf logger that
uses the new Histogram C++ API. I add a flag that chooses
between the two implementations so I can try it out (perhaps by
setting up a second, limited run of webrtc_perf_tests on the perf
bots that uses the new implementation). The histogram C++
implementation will come in the next patch.

As a side effect, I disentangled the plottable counter printer from
the perf result printer so it will work for both implementations.
The only thing they had in common was that both wrote JSON anyway.

See the bug for details on the new API.

Bug: chromium:1029452
Change-Id: Icb21b25ced08ea73aeecd221e9d51f2adf3dab1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/165389
Reviewed-by: Artem Titov <titovartem@webrtc.org>
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30243}
diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn
index bd4d5ad..8ca20af 100644
--- a/rtc_tools/BUILD.gn
+++ b/rtc_tools/BUILD.gn
@@ -80,6 +80,7 @@
 }
 
 rtc_library("video_quality_analysis") {
+  testonly = true
   sources = [
     "frame_analyzer/linear_least_squares.cc",
     "frame_analyzer/linear_least_squares.h",
@@ -207,6 +208,7 @@
   }
 
   rtc_library("reference_less_video_analysis_lib") {
+    testonly = true
     sources = [
       "frame_analyzer/reference_less_video_analysis_lib.cc",
       "frame_analyzer/reference_less_video_analysis_lib.h",