lordgamez commented on code in PR #1909:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1909#discussion_r1918500498
##########
libminifi/src/core/state/nodes/FlowInformation.cpp:
##########
@@ -61,19 +61,42 @@ std::vector<SerializedResponseNode>
FlowInformation::serialize() {
serialized.push_back(queues);
}
+ std::unordered_map<std::string, bool> processors_running;
if (nullptr != monitor_) {
- SerializedResponseNode componentsNode{.name = "components", .collapsible =
false};
- monitor_->executeOnAllComponents([&componentsNode](StateController&
component){
- componentsNode.children.push_back({
- .name = component.getComponentName(),
+ monitor_->executeOnAllComponents([&processors_running](StateController&
component){
+ processors_running[component.getComponentUUID().to_string()] =
component.isRunning();
+ });
+ }
+
+ if (!processors_.empty()) {
+ SerializedResponseNode processorsStatusesNode{.name = "processorStatuses",
.array = true, .collapsible = false};
+ for (const auto processor : processors_) {
+ if (!processor) {
+ continue;
+ }
+
+ auto metrics = processor->getMetrics();
+ processorsStatusesNode.children.push_back({
+ .name = processor->getName(),
.collapsible = false,
.children = {
- {.name = "running", .value = component.isRunning()},
- {.name = "uuid", .value =
std::string{component.getComponentUUID().to_string()}}
+ {.name = "id", .value = std::string{processor->getUUIDStr()}},
+ {.name = "groupId", .value = processor->getProcessGroupUUIDStr()},
+ {.name = "bytesRead", .value = metrics->bytes_read.load()},
+ {.name = "bytesWritten", .value = metrics->bytes_written.load()},
+ {.name = "flowFilesIn", .value =
metrics->incoming_flow_files.load()},
+ {.name = "flowFilesOut", .value =
metrics->transferred_flow_files.load()},
+ {.name = "bytesIn", .value = metrics->incoming_bytes.load()},
+ {.name = "bytesOut", .value = metrics->transferred_bytes.load()},
+ {.name = "invocations", .value = metrics->invocations.load()},
+ {.name = "processingNanos", .value =
metrics->processing_nanos.load()},
+ {.name = "activeThreadCount", .value = -1},
+ {.name = "terminatedThreadCount", .value = -1},
+ {.name = "running", .value =
(processors_running.contains(processor->getUUIDStr()) ?
processors_running[processor->getUUIDStr()] : false)}
Review Comment:
Moved the FlowController level `running` field under flowInfo/running in
https://github.com/apache/nifi-minifi-cpp/pull/1909/commits/36f3262ba5901b9f59828db052cb9ac1a5bdef2e
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]