feat(trigger): added working robust repartitioning trigger system
more work is needed to identify the most robust set of criteria to trigger on but the system is now very easy to exend, probe, and use.
This commit is contained in:
17
src/include/gridfire/trigger/procedures/trigger_pprint.h
Normal file
17
src/include/gridfire/trigger/procedures/trigger_pprint.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "gridfire/trigger/trigger_result.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace gridfire::trigger {
|
||||
inline void printWhy(const TriggerResult& result, const int indent = 0) {
|
||||
const std::string prefix(indent * 2, ' ');
|
||||
std::cout << prefix << "• [" << (result.value ? "TRUE" : "FALSE")
|
||||
<< "] " << result.name << ": " << result.description << std::endl;
|
||||
|
||||
for (const auto& cause : result.causes) {
|
||||
printWhy(cause, indent + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user