aboutsummaryrefslogtreecommitdiff
path: root/tests/framework/printers/JSONPrinter.cpp
diff options
context:
space:
mode:
authorAnthony Barbier <anthony.barbier@arm.com>2018-01-26 16:07:50 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:45:00 +0000
commitc9afce52fe412e6f09917345b198a1f497571e8d (patch)
treec94791d2bad924cda69ff170001005497d2b761f /tests/framework/printers/JSONPrinter.cpp
parentf6402dd37092c842d1de9998b23640caf12f227b (diff)
downloadComputeLibrary-c9afce52fe412e6f09917345b198a1f497571e8d.tar.gz
COMPMID-863: Remove some of the post-processing from the JSON backend
Refactored the console printer too (So that we can re-use the code if needed) Change-Id: I16a0f70104f82f07cd59900b383038fa5a76e1bc Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/117858 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'tests/framework/printers/JSONPrinter.cpp')
-rw-r--r--tests/framework/printers/JSONPrinter.cpp30
1 files changed, 2 insertions, 28 deletions
diff --git a/tests/framework/printers/JSONPrinter.cpp b/tests/framework/printers/JSONPrinter.cpp
index 676ec69336..6b982f5bb0 100644
--- a/tests/framework/printers/JSONPrinter.cpp
+++ b/tests/framework/printers/JSONPrinter.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -179,26 +179,6 @@ void JSONPrinter::print_measurements(const Profiler::MeasurementsMap &measuremen
{
*_stream << R"(")" << i_it->first << R"(" : {)";
- auto add_measurements = [](Measurement::Value a, const Measurement & b)
- {
- return a + b.value();
- };
-
- auto cmp_measurements = [](const Measurement & a, const Measurement & b)
- {
- return a.value() < b.value();
- };
-
- int num_values = i_it->second.size();
- const auto minmax_values = std::minmax_element(i_it->second.begin(), i_it->second.end(), cmp_measurements);
-
- Measurement::Value sum_values = std::accumulate(i_it->second.cbegin(), i_it->second.cend(), Measurement::Value(minmax_values.first->value().is_floating_point), add_measurements);
- if(num_values > 2)
- {
- sum_values -= minmax_values.first->value() + minmax_values.second->value();
- num_values -= 2;
- }
-
auto measurement_to_string = [](const Measurement & measurement)
{
if(measurement.raw_data().size() == 1)
@@ -214,14 +194,8 @@ void JSONPrinter::print_measurements(const Profiler::MeasurementsMap &measuremen
return str.str();
}
};
- *_stream << R"("avg" : )" << (sum_values / num_values) << ",";
- if(num_values > 1)
- {
- *_stream << R"("min" : )" << minmax_values.first->value() << ",";
- *_stream << R"("max" : )" << minmax_values.second->value() << ",";
- }
*_stream << R"("raw" : [)" << join(i_it->second.begin(), i_it->second.end(), ",", measurement_to_string) << "],";
- *_stream << R"("unit" : ")" << minmax_values.first->unit() << R"(")";
+ *_stream << R"("unit" : ")" << i_it->second.begin()->unit() << R"(")";
*_stream << "}";
if(++i_it != i_end)