forked from apache/nifi-minifi-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MINIFICPP-2502 Add processorBulletins C2 metric node to FlowInformation
- Loading branch information
Showing
24 changed files
with
260 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <deque> | ||
#include <mutex> | ||
|
||
namespace org::apache::nifi::minifi::core { | ||
|
||
struct Bulletin { | ||
uint64_t id; | ||
std::string timestamp; // "Tue Dec 10 08:40:26 CET 2024", | ||
// std::string node_address; // empty | ||
std::string level; | ||
std::string category; | ||
std::string message; | ||
std::string group_id; | ||
std::string group_name; | ||
std::string group_path; | ||
std::string source_id; | ||
std::string source_name; | ||
// std::string flow_file_uuid; // empty | ||
}; | ||
|
||
class BulletinStore { | ||
public: | ||
void addBulletin(Bulletin& bulletin) { | ||
std::lock_guard<std::mutex> lock(mutex_); | ||
bulletin.id = id_counter++; | ||
if (bulletins_.size() >= MAX_BULLETIN_COUNT) { | ||
bulletins_.pop_front(); | ||
} | ||
bulletins_.push_back(bulletin); | ||
} | ||
|
||
std::deque<Bulletin> getBulletins() const { | ||
std::lock_guard<std::mutex> lock(mutex_); | ||
return bulletins_; | ||
} | ||
|
||
private: | ||
static constexpr uint64_t MAX_BULLETIN_COUNT = 10000; | ||
mutable std::mutex mutex_; | ||
uint64_t id_counter = 1; | ||
std::deque<Bulletin> bulletins_; | ||
}; | ||
|
||
} // namespace org::apache::nifi::minifi::core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.