| Index: base/test/launcher/test_launcher.cc
|
| diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc
|
| index 1e2a95b0daa7a6813d8a844d7a46885a2ded8a03..9195606b57dbd70ce9b21cdba8be8ac16d1cbcb6 100644
|
| --- a/base/test/launcher/test_launcher.cc
|
| +++ b/base/test/launcher/test_launcher.cc
|
| @@ -21,6 +21,8 @@
|
| #include "base/macros.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/message_loop/message_loop.h"
|
| +#include "base/metrics/histogram_macros_local.h"
|
| +#include "base/metrics/statistics_recorder.h"
|
| #include "base/process/kill.h"
|
| #include "base/process/launch.h"
|
| #include "base/run_loop.h"
|
| @@ -75,6 +77,9 @@ namespace {
|
| // for any reason, e.g. early exit because of too many broken tests.
|
| const char kUnreliableResultsTag[] = "UNRELIABLE_RESULTS";
|
|
|
| +// Name of the local histogram to measure test output size.
|
| +const char kOutputSizeHistogramName[] = "TestLauncher.TestOutputSize";
|
| +
|
| // Maximum time of no output after which we print list of processes still
|
| // running. This deliberately doesn't use TestTimeouts (which is otherwise
|
| // a recommended solution), because they can be increased. This would defeat
|
| @@ -542,6 +547,11 @@ bool TestLauncher::Run() {
|
|
|
| MaybeSaveSummaryAsJSON(std::vector<std::string>());
|
|
|
| + std::string output_histogram;
|
| + StatisticsRecorder::WriteGraph(kOutputSizeHistogramName, &output_histogram);
|
| + fprintf(stdout, "%s", output_histogram.c_str());
|
| + fflush(stdout);
|
| +
|
| return run_result_;
|
| }
|
|
|
| @@ -577,6 +587,9 @@ void TestLauncher::OnTestFinished(const TestResult& original_result) {
|
|
|
| TestResult result(original_result);
|
|
|
| + LOCAL_HISTOGRAM_CUSTOM_COUNTS(
|
| + kOutputSizeHistogramName, result.output_snippet.length(),
|
| + 1, 10000000, 50);
|
| if (result.output_snippet.length() > kOutputSnippetBytesLimit) {
|
| if (result.status == TestResult::TEST_SUCCESS)
|
| result.status = TestResult::TEST_EXCESSIVE_OUTPUT;
|
| @@ -946,6 +959,8 @@ bool TestLauncher::Init() {
|
| results_tracker_.AddGlobalTag("CPU_64_BITS");
|
| #endif
|
|
|
| + StatisticsRecorder::Initialize();
|
| +
|
| return true;
|
| }
|
|
|
|
|