Skip to content

Commit

Permalink
MINIFICPP-2516 Change C2 runStatus value format to be consistent with…
Browse files Browse the repository at this point in the history
… NiFi

Closes apache#1921

Signed-off-by: Marton Szasz <szaszm@apache.org>
  • Loading branch information
lordgamez authored and martinzink committed Feb 5, 2025
1 parent 1f72e02 commit b846c13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions C2.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ configuration produces the following JSON:
"processingNanos": 0,
"activeThreadCount": -1,
"terminatedThreadCount": -1,
"runStatus": "Running"
"runStatus": "RUNNING"
},
{
"id": "4fe2d51d-076a-49b0-88de-5cf5adf52b8f",
Expand All @@ -223,11 +223,11 @@ configuration produces the following JSON:
"processingNanos": 2119148,
"activeThreadCount": -1,
"terminatedThreadCount": -1,
"runStatus": "Running"
"runStatus": "RUNNING"
}
],
"flowId": "96273342-b9fe-11ef-a0ad-10f60a596f64",
"runStatus": "Running"
"runStatus": "RUNNING"
}
},
"LoadMetrics": {
Expand Down Expand Up @@ -550,7 +550,7 @@ Contains information about the flow the agent is running, including the versione
"processingNanos": 0,
"activeThreadCount": -1,
"terminatedThreadCount": -1,
"running": true
"runStatus": "RUNNING"
},
{
"id": "4fe2d51d-076a-49b0-88de-5cf5adf52b8f",
Expand All @@ -565,11 +565,11 @@ Contains information about the flow the agent is running, including the versione
"processingNanos": 2119148,
"activeThreadCount": -1,
"terminatedThreadCount": -1,
"running": true
"runStatus": "RUNNING"
}
],
"flowId": "96273342-b9fe-11ef-a0ad-10f60a596f64",
"running": true
"runStatus": "RUNNING"
}
```

Expand Down
4 changes: 2 additions & 2 deletions libminifi/src/core/state/nodes/FlowInformation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ std::vector<SerializedResponseNode> FlowInformation::serialize() {

if (nullptr != monitor_) {
monitor_->executeOnComponent("FlowController", [&serialized](StateController& component) {
serialized.push_back({.name = "runStatus", .value = (component.isRunning() ? "Running" : "Stopped")});
serialized.push_back({.name = "runStatus", .value = (component.isRunning() ? "RUNNING" : "STOPPED")});
});
}

Expand Down Expand Up @@ -92,7 +92,7 @@ std::vector<SerializedResponseNode> FlowInformation::serialize() {
{.name = "processingNanos", .value = metrics->processingNanos().load()},
{.name = "activeThreadCount", .value = -1},
{.name = "terminatedThreadCount", .value = -1},
{.name = "runStatus", .value = (processor->isRunning() ? "Running" : "Stopped")}
{.name = "runStatus", .value = (processor->isRunning() ? "RUNNING" : "STOPPED")}
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions libminifi/test/integration/C2MetricsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class MetricsHandler: public HeartbeatHandler {
processor["processingNanos"].GetInt() >= 0 &&
processor["activeThreadCount"].GetInt() == -1 &&
processor["terminatedThreadCount"].GetInt() == -1 &&
processor["runStatus"].GetString() == std::string("Running");
processor["runStatus"].GetString() == std::string("RUNNING");
}

static bool verifyCommonRuntimeMetricNodes(const rapidjson::Value& runtime_metrics, const std::string& queue_id) {
Expand All @@ -151,7 +151,7 @@ class MetricsHandler: public HeartbeatHandler {
runtime_metrics.HasMember("flowInfo") &&
runtime_metrics["flowInfo"].HasMember("flowId") &&
runtime_metrics["flowInfo"].HasMember("runStatus") &&
runtime_metrics["flowInfo"]["runStatus"].GetString() == std::string("Running") &&
runtime_metrics["flowInfo"]["runStatus"].GetString() == std::string("RUNNING") &&
runtime_metrics["flowInfo"].HasMember("versionedFlowSnapshotURI") &&
runtime_metrics["flowInfo"].HasMember("queues") &&
runtime_metrics["flowInfo"]["queues"].HasMember(queue_id) &&
Expand Down

0 comments on commit b846c13

Please sign in to comment.