MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / print_measurements

Method print_measurements

tests/framework/printers/JSONPrinter.cpp:191–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189}
190
191void JSONPrinter::print_measurements(const Profiler::MeasurementsMap &measurements)
192{
193 print_separator(_first_test_entry);
194 *_stream << R"("measurements" : {)";
195
196 for (auto i_it = measurements.cbegin(), i_end = measurements.cend(); i_it != i_end;)
197 {
198 *_stream << R"(")" << i_it->first << R"(" : {)";
199
200 auto measurement_to_string = [](const Measurement &measurement)
201 {
202 if (measurement.raw_data().size() == 1)
203 {
204 return measurement.raw_data().front();
205 }
206 else
207 {
208 std::stringstream str;
209 str << R"([")";
210 str << join(measurement.raw_data().begin(), measurement.raw_data().end(), R"(",")");
211 str << R"("])";
212 return str.str();
213 }
214 };
215 *_stream << R"("raw" : [)" << join(i_it->second.begin(), i_it->second.end(), ",", measurement_to_string)
216 << "],";
217 *_stream << R"("unit" : ")" << i_it->second.begin()->unit() << R"(")";
218 *_stream << "}";
219
220 if (++i_it != i_end)
221 {
222 *_stream << ",";
223 }
224 }
225
226 *_stream << "}";
227}
228} // namespace framework
229} // namespace test
230} // namespace arm_compute

Callers 3

mainFunction · 0.45
log_test_endMethod · 0.45
print_test_resultsMethod · 0.45

Calls 7

strMethod · 0.80
joinFunction · 0.50
cbeginMethod · 0.45
cendMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected