MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / format

Method format

performance-tests/bench/report_parser/TimeSeriesRawFormatter.cpp:37–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37int TimeSeriesRawFormatter::format(const Bench::TestController::Report& report, std::ostream& output_stream, const ParseParameters& parse_parameters)
38{
39 SharedSummaryReportVisitor visitor;
40
41 if (!parse_parameters.tags.empty()) {
42 visitor.tags_ = parse_parameters.tags;
43 }
44
45 if (!parse_parameters.stats.empty()) {
46 visitor.stats_ = parse_parameters.stats;
47 }
48
49 visit_report(report, visitor);
50
51 const auto& tags = visitor.tags_;
52 const auto& stats = visitor.stats_;
53 const auto& untagged_stat_vecs = visitor.untagged_stat_vecs_;
54 const auto& tagged_stat_vecs = visitor.tagged_stat_vecs_;
55
56 SimpleStatBlockMap untagged_stat_map;
57 std::map<std::string, SimpleStatBlockMap> tagged_stat_map;
58
59 size_t untagged_rows = 0;
60 for (auto stat_it = stats.begin(); stat_it != stats.end(); ++stat_it) {
61 auto stat_pos = untagged_stat_vecs.find(*stat_it);
62 if (stat_pos != untagged_stat_vecs.end()) {
63 untagged_stat_map[*stat_it] = consolidate(stat_pos->second);
64 if (untagged_rows < untagged_stat_map[*stat_it].median_buffer_.size()) {
65 untagged_rows = untagged_stat_map[*stat_it].median_buffer_.size();
66 }
67 }
68 }
69
70 write_series(untagged_stat_map, output_stream, untagged_rows);
71
72 for (auto tags_it = tags.begin(); tags_it != tags.end(); ++tags_it) {
73 auto tag_pos = tagged_stat_vecs.find(*tags_it);
74 if (tag_pos != tagged_stat_vecs.end()) {
75 size_t tagged_rows = 0;
76 for (auto stat_it = stats.begin(); stat_it != stats.end(); ++stat_it) {
77 auto stat_pos = tag_pos->second.find(*stat_it);
78 if (stat_pos != tag_pos->second.end()) {
79 tagged_stat_map[*tags_it][*stat_it] = consolidate(stat_pos->second);
80 if (tagged_rows < tagged_stat_map[*tags_it][*stat_it].median_buffer_.size()) {
81 tagged_rows = tagged_stat_map[*tags_it][*stat_it].median_buffer_.size();
82 }
83 }
84 }
85 write_series(tagged_stat_map[*tags_it], output_stream, tagged_rows);
86 }
87 }
88
89 return EXIT_SUCCESS;
90}
91
92} // namespace Bench

Callers

nothing calls this directly

Calls 8

visit_reportFunction · 0.85
consolidateFunction · 0.85
write_seriesFunction · 0.70
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected