Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2171#discussion_r142978137
--- Diff:
nifi-nar-bundles/nifi-metrics-reporting-bundle/nifi-metrics-reporting-task/src/main/java/org/apache/nifi/metrics/reporting/reporter/service/GraphiteMetricReporterService.java
---
@@ -0,0 +1,147 @@
+/*
+ * 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.
+ */
+package org.apache.nifi.metrics.reporting.reporter.service;
+
+import com.codahale.metrics.MetricRegistry;
+import com.codahale.metrics.ScheduledReporter;
+import com.codahale.metrics.graphite.Graphite;
+import com.codahale.metrics.graphite.GraphiteReporter;
+import com.codahale.metrics.graphite.GraphiteSender;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnDisabled;
+import org.apache.nifi.annotation.lifecycle.OnEnabled;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.AbstractControllerService;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.metrics.reporting.task.MetricsReportingTask;
+import org.apache.nifi.processor.util.StandardValidators;
+
+import javax.net.SocketFactory;
+import java.io.IOException;
+import java.nio.charset.Charset;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * A controller service that provides metric reporters for graphite, can
be used by {@link MetricsReportingTask}.
+ *
+ * @author Omer Hadari
+ */
+@Tags({"metrics", "reporting", "graphite"})
+@CapabilityDescription("A controller service that provides metric
reporters for graphite. " +
+ "Used by MetricsReportingTask.")
+public class GraphiteMetricReporterService extends
AbstractControllerService implements MetricReporterService {
+
+ /** Points to the hostname of the graphite listener. */
+ public static final PropertyDescriptor HOST = new
PropertyDescriptor.Builder()
+ .name("host")
+ .displayName("host")
+ .description("The hostname of the carbon listener")
+ .required(true)
+ .addValidator(StandardValidators.URI_VALIDATOR)
+ .build();
+
+ /** Points to the port on which the graphite server listens. */
+ public static final PropertyDescriptor PORT = new
PropertyDescriptor.Builder()
+ .name("port")
+ .displayName("port")
--- End diff --
Should be "Port" for consistency in the UI
---