24 #include <unordered_map>
78 const std::unordered_map<std::string, std::shared_ptr<Relation>>& relationMap =
81 for (
auto&
rel : relationMap) {
82 std::shared_ptr<Relation> r =
rel.second;
84 auto total_time = r->getNonRecTime() + r->getRecTime() + r->getCopyTime();
85 row[0] = std::make_shared<Cell<std::chrono::microseconds>>(total_time);
86 row[1] = std::make_shared<Cell<std::chrono::microseconds>>(r->getNonRecTime());
87 row[2] = std::make_shared<Cell<std::chrono::microseconds>>(r->getRecTime());
88 row[3] = std::make_shared<Cell<std::chrono::microseconds>>(r->getCopyTime());
89 row[4] = std::make_shared<Cell<long>>(r->size());
90 row[5] = std::make_shared<Cell<std::string>>(r->getName());
91 row[6] = std::make_shared<Cell<std::string>>(r->getId());
92 row[7] = std::make_shared<Cell<std::string>>(r->getLocator());
93 if (total_time.count() != 0) {
94 row[8] = std::make_shared<Cell<long>>(r->size() / (total_time.count() / 1000000.0));
96 row[8] = std::make_shared<Cell<long>>(r->size());
98 row[9] = std::make_shared<Cell<std::chrono::microseconds>>(r->getLoadtime());
99 row[10] = std::make_shared<Cell<std::chrono::microseconds>>(r->getSavetime());
100 row[11] = std::make_shared<Cell<long>>(r->getMaxRSSDiff());
101 row[12] = std::make_shared<Cell<long>>(r->getReads());
103 table.
addRow(std::make_shared<Row>(row));
122 const std::unordered_map<std::string, std::shared_ptr<Relation>>& relationMap =
124 std::unordered_map<std::string, std::shared_ptr<Row>> ruleMap;
126 for (
auto&
rel : relationMap) {
127 for (
auto& current :
rel.second->getRuleMap()) {
129 std::shared_ptr<Rule>
rule = current.second;
130 row[0] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
131 row[1] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
132 row[2] = std::make_shared<Cell<std::chrono::microseconds>>(std::chrono::microseconds(0));
133 row[3] = std::make_shared<Cell<std::chrono::microseconds>>(std::chrono::microseconds(0));
134 row[4] = std::make_shared<Cell<long>>(
rule->size());
135 row[5] = std::make_shared<Cell<std::string>>(
rule->getName());
136 row[6] = std::make_shared<Cell<std::string>>(
rule->getId());
137 row[7] = std::make_shared<Cell<std::string>>(
rel.second->getName());
138 row[8] = std::make_shared<Cell<long>>(0);
139 row[10] = std::make_shared<Cell<std::string>>(
rule->getLocator());
140 ruleMap.emplace(
rule->getName(), std::make_shared<Row>(row));
142 for (
auto& iter :
rel.second->getIterations()) {
143 for (
auto& current : iter->getRules()) {
144 std::shared_ptr<Rule>
rule = current.second;
145 if (ruleMap.find(
rule->getName()) != ruleMap.end()) {
146 Row row = *ruleMap[
rule->getName()];
147 row[2] = std::make_shared<Cell<std::chrono::microseconds>>(
148 row[2]->getTimeVal() +
rule->getRuntime());
149 row[4] = std::make_shared<Cell<long>>(row[4]->getLongVal() +
rule->size());
150 row[0] = std::make_shared<Cell<std::chrono::microseconds>>(
151 row[0]->getTimeVal() +
rule->getRuntime());
152 ruleMap[
rule->getName()] = std::make_shared<Row>(row);
155 row[0] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
156 row[1] = std::make_shared<Cell<std::chrono::microseconds>>(std::chrono::microseconds(0));
157 row[2] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
158 row[3] = std::make_shared<Cell<std::chrono::microseconds>>(std::chrono::microseconds(0));
159 row[4] = std::make_shared<Cell<long>>(
rule->size());
160 row[5] = std::make_shared<Cell<std::string>>(
rule->getName());
161 row[6] = std::make_shared<Cell<std::string>>(
rule->getId());
162 row[7] = std::make_shared<Cell<std::string>>(
rel.second->getName());
163 row[8] = std::make_shared<Cell<long>>(
rule->getVersion());
164 row[10] = std::make_shared<Cell<std::string>>(
rule->getLocator());
165 ruleMap[
rule->getName()] = std::make_shared<Row>(row);
169 for (
auto& current : ruleMap) {
170 std::shared_ptr<Row> row = current.second;
172 std::chrono::microseconds val = t[1]->getTimeVal() + t[2]->getTimeVal() + t[3]->getTimeVal();
174 t[0] = std::make_shared<Cell<std::chrono::microseconds>>(val);
176 if (t[0]->getTimeVal().count() != 0) {
177 t[9] = std::make_shared<Cell<double>>(t[4]->getLongVal() / (t[0]->getDoubleVal() * 1000));
179 t[9] = std::make_shared<Cell<double>>(t[4]->getLongVal() / 1.0);
181 current.second = std::make_shared<Row>(t);
186 for (
auto& current : ruleMap) {
187 table.
addRow(current.second);
200 const std::unordered_map<std::string, std::shared_ptr<Relation>>& relationMap =
204 for (
auto& current : relationMap) {
205 std::shared_ptr<Relation>
rel = current.second;
207 if (
rel->getId() != strRel) {
211 for (
auto& current :
rel->getRuleMap()) {
212 std::shared_ptr<Rule>
rule = current.second;
213 if (
rule->getId() != strRul) {
216 for (
auto& atom :
rule->getAtoms()) {
218 row[0] = std::make_shared<Cell<std::string>>(atom.rule);
219 row[1] = std::make_shared<Cell<std::string>>(atom.identifier);
220 row[2] = std::make_shared<Cell<long>>(atom.level);
221 row[3] = std::make_shared<Cell<long>>(atom.frequency);
223 table.
addRow(std::make_shared<Row>(row));
235 const std::unordered_map<std::string, std::shared_ptr<Relation>>& relationMap =
239 for (
auto& current : relationMap) {
240 std::shared_ptr<Relation>
rel = current.second;
242 if (
rel->getId() != strRel) {
246 for (
auto& current :
rel->getRuleMap()) {
247 std::shared_ptr<Rule>
rule = current.second;
248 if (
rule->getId() != strRul) {
251 for (
auto& atom :
rule->getAtoms()) {
253 row[0] = std::make_shared<Cell<std::string>>(atom.rule);
255 table.
addRow(std::make_shared<Row>(row));
277 const std::unordered_map<std::string, std::shared_ptr<Relation>>& relationMap =
281 std::shared_ptr<Relation>
rel;
282 for (
auto& current : relationMap) {
283 if (current.second->getId() == strRel) {
284 rel = current.second;
288 if (
rel ==
nullptr) {
292 std::unordered_map<std::string, std::shared_ptr<Row>> ruleMap;
293 for (
auto& iter :
rel->getIterations()) {
294 for (
auto& current : iter->getRules()) {
295 std::shared_ptr<Rule>
rule = current.second;
296 if (
rule->getId() == strRul) {
297 std::string strTemp =
298 rule->getName() +
rule->getLocator() + std::to_string(
rule->getVersion());
300 if (ruleMap.find(strTemp) != ruleMap.end()) {
301 Row row = *ruleMap[strTemp];
302 row[2] = std::make_shared<Cell<std::chrono::microseconds>>(
303 row[2]->getTimeVal() +
rule->getRuntime());
304 row[4] = std::make_shared<Cell<long>>(row[4]->getLongVal() +
rule->size());
305 row[0] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
306 ruleMap[strTemp] = std::make_shared<Row>(row);
309 row[1] = std::make_shared<Cell<std::chrono::microseconds>>(std::chrono::microseconds(0));
310 row[2] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
311 row[3] = std::make_shared<Cell<std::chrono::microseconds>>(std::chrono::microseconds(0));
312 row[4] = std::make_shared<Cell<long>>(
rule->size());
313 row[5] = std::make_shared<Cell<std::string>>(
rule->getName());
314 row[6] = std::make_shared<Cell<std::string>>(
rule->getId());
315 row[7] = std::make_shared<Cell<std::string>>(
rel->getName());
316 row[8] = std::make_shared<Cell<long>>(
rule->getVersion());
317 row[9] = std::make_shared<Cell<std::string>>(
rule->getLocator());
318 row[0] = std::make_shared<Cell<std::chrono::microseconds>>(
rule->getRuntime());
319 ruleMap[strTemp] = std::make_shared<Row>(row);
325 for (
auto row : ruleMap) {
327 t[0] = std::make_shared<Cell<std::chrono::microseconds>>(
328 t[1]->getTimeVal() + t[2]->getTimeVal() + t[3]->getTimeVal());
329 ruleMap[row.first] = std::make_shared<Row>(t);
332 for (
auto& current : ruleMap) {
333 table.
addRow(current.second);
346 const std::unordered_map<std::string, std::shared_ptr<Relation>>& relationMap =
349 std::shared_ptr<Relation>
rel;
351 for (
auto& current : relationMap) {
352 if (current.second->getId() == strRel) {
353 rel = current.second;
357 if (
rel ==
nullptr) {
361 for (
auto& iter :
rel->getIterations()) {
362 for (
auto& current : iter->getRules()) {
363 std::shared_ptr<Rule>
rule = current.second;
364 if (
rule->getLocator() == srcLocator &&
rule->getVersion() == version) {
365 for (
auto& atom :
rule->getAtoms()) {
367 row[0] = std::make_shared<Cell<std::string>>(atom.rule);
368 row[1] = std::make_shared<Cell<std::string>>(atom.identifier);
369 row[2] = std::make_shared<Cell<long>>(atom.level);
370 row[3] = std::make_shared<Cell<long>>(atom.frequency);
371 table.
addRow(std::make_shared<Row>(row));