|
4 | 4 | #include <chimbuko/param.hpp> |
5 | 5 | #include "chimbuko/ad/ADCounter.hpp" |
6 | 6 | #include "chimbuko/ad/ADMetadataParser.hpp" |
| 7 | +#include "chimbuko/ad/ADNormalEventProvenance.hpp" |
| 8 | +#include "chimbuko/util/Anomalies.hpp" |
| 9 | +#include "chimbuko/util/PerfStats.hpp" |
7 | 10 |
|
8 | 11 | namespace chimbuko{ |
9 | 12 |
|
@@ -38,6 +41,71 @@ namespace chimbuko{ |
38 | 41 | */ |
39 | 42 | nlohmann::json get_json() const; |
40 | 43 |
|
| 44 | + /** |
| 45 | + * @brief Extract the json provDB entries for the anomalies and normal events from an Anomalies collection |
| 46 | + * |
| 47 | + * @param anom_event_entries The provDB entries for anomalous events |
| 48 | + * @param normal_event_entries The provDB entries for normal events |
| 49 | + * @param normal_event_manager An instance of ADNormalEventProvenance that maintains normal events between calls |
| 50 | + * @param perf Performance timing |
| 51 | + * @param anomalies The Anomalies object containing anomalies and select normal events for this io step |
| 52 | + * @param step The io step |
| 53 | + * @param first_event_ts The timestamp of the first event in the io step |
| 54 | + * @param last_event_ts The timestamp of the last event in the io step |
| 55 | + * @param anom_win_size The window size of events to capture around each anomaly |
| 56 | + * @param algo_params The outlier algorithm parameters |
| 57 | + * @param event_man The event manager object |
| 58 | + * @param counters The counter manager object |
| 59 | + * @param metadata The metadata manager object |
| 60 | + */ |
| 61 | + static void getProvenanceEntries(std::vector<nlohmann::json> &anom_event_entries, |
| 62 | + std::vector<nlohmann::json> &normal_event_entries, |
| 63 | + ADNormalEventProvenance &normal_event_manager, |
| 64 | + PerfStats &perf, |
| 65 | + const Anomalies &anomalies, |
| 66 | + const int step, |
| 67 | + const unsigned long first_event_ts, |
| 68 | + const unsigned long last_event_ts, |
| 69 | + const unsigned int anom_win_size, |
| 70 | + const ParamInterface &algo_params, |
| 71 | + const ADEvent &event_man, |
| 72 | + const ADCounter &counters, |
| 73 | + const ADMetadataParser &metadata); |
| 74 | + |
| 75 | + /** |
| 76 | + * @brief Extract the json provDB entries for the anomalies and normal events from an Anomalies collection |
| 77 | + * |
| 78 | + * @param anom_event_entries The provDB entries for anomalous events |
| 79 | + * @param normal_event_entries The provDB entries for normal events |
| 80 | + * @param normal_event_manager An instance of ADNormalEventProvenance that maintains normal events between calls |
| 81 | + * @param anomalies The Anomalies object containing anomalies and select normal events for this io step |
| 82 | + * @param step The io step |
| 83 | + * @param first_event_ts The timestamp of the first event in the io step |
| 84 | + * @param last_event_ts The timestamp of the last event in the io step |
| 85 | + * @param anom_win_size The window size of events to capture around each anomaly |
| 86 | + * @param algo_params The outlier algorithm parameters |
| 87 | + * @param event_man The event manager object |
| 88 | + * @param counters The counter manager object |
| 89 | + * @param metadata The metadata manager object |
| 90 | + */ |
| 91 | + static void getProvenanceEntries(std::vector<nlohmann::json> &anom_event_entries, |
| 92 | + std::vector<nlohmann::json> &normal_event_entries, |
| 93 | + ADNormalEventProvenance &normal_event_manager, |
| 94 | + const Anomalies &anomalies, |
| 95 | + const int step, |
| 96 | + const unsigned long first_event_ts, |
| 97 | + const unsigned long last_event_ts, |
| 98 | + const unsigned int anom_win_size, |
| 99 | + const ParamInterface &algo_params, |
| 100 | + const ADEvent &event_man, |
| 101 | + const ADCounter &counters, |
| 102 | + const ADMetadataParser &metadata){ |
| 103 | + PerfStats perf; |
| 104 | + getProvenanceEntries(anom_event_entries, normal_event_entries, |
| 105 | + normal_event_manager, perf, anomalies, step, first_event_ts, last_event_ts, |
| 106 | + anom_win_size, algo_params, event_man, counters, metadata); |
| 107 | + } |
| 108 | + |
41 | 109 | private: |
42 | 110 | /** |
43 | 111 | * @brief Get the call stack |
|
0 commit comments