fgerlits commented on code in PR #2020:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2020#discussion_r2436229591
##########
core-framework/include/core/ProcessorImpl.h:
##########
@@ -143,7 +142,7 @@ class ProcessorImpl : public virtual ProcessorApi {
std::atomic<bool> trigger_when_empty_;
- gsl::not_null<std::shared_ptr<ProcessorMetrics>> metrics_;
+ std::shared_ptr<CustomProcessorMetrics> metrics_;
Review Comment:
I would rename this to `custom_metrics_`, and also rename `getMetrics()` at
line 121 to `getCustomMetrics()`, to distinguish it better from the `metrics_`
field in the `Processor` class.
##########
minifi-api/include/minifi-cpp/core/CustomProcessorMetrics.h:
##########
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#pragma once
+
+#include <vector>
+
+#include "minifi-cpp/core/state/Value.h"
+#include "minifi-cpp/core/state/PublishedMetricProvider.h"
+
+namespace org::apache::nifi::minifi::core {
+
+class CustomProcessorMetrics : public virtual state::PublishedMetricProvider {
Review Comment:
nitpicking, but can this `virtual` be removed?
##########
libminifi/src/core/Processor.cpp:
##########
@@ -531,10 +535,14 @@ annotation::Input Processor::getInputRequirement() const {
}
state::response::SharedResponseNode Processor::getResponseNode() {
- return getMetrics();
+ return metrics_;
}
Review Comment:
It looks to me like this function used to return all metrics (standard +
custom), but it only returns the standard metrics now.
--
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]