MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / initializeComponentMetrics

Method initializeComponentMetrics

libminifi/src/c2/C2Client.cpp:136–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void C2Client::initializeComponentMetrics() {
137 {
138 std::lock_guard<std::mutex> guard(metrics_mutex_);
139 component_metrics_.clear();
140 }
141
142 if (root_ == nullptr) {
143 return;
144 }
145 std::vector<std::shared_ptr<core::Processor>> processors;
146 root_->getAllProcessors(processors);
147 for (const auto &processor : processors) {
148 auto rep = std::dynamic_pointer_cast<state::response::ResponseNodeSource>(processor);
149 if (rep == nullptr) {
150 continue;
151 }
152 // we have a metrics source.
153 std::vector<std::shared_ptr<state::response::ResponseNode>> metric_vector;
154 rep->getResponseNodes(metric_vector);
155 std::lock_guard<std::mutex> guard(metrics_mutex_);
156 for (auto& metric : metric_vector) {
157 component_metrics_[metric->getName()] = metric;
158 }
159 }
160}
161
162void C2Client::loadC2ResponseConfiguration(const std::string &prefix) {
163 std::string class_definitions;

Callers

nothing calls this directly

Calls 4

getAllProcessorsMethod · 0.80
getResponseNodesMethod · 0.80
clearMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected