Search in sources :

Example 1 with ConnectionStatusDescriptor

use of org.apache.nifi.controller.status.history.ConnectionStatusDescriptor in project nifi by apache.

the class StatusHistoryEndpointMerger method getStandardMetricDescriptors.

private Map<String, MetricDescriptor<?>> getStandardMetricDescriptors(final URI uri) {
    final String path = uri.getPath();
    final Map<String, MetricDescriptor<?>> metricDescriptors = new HashMap<>();
    if (PROCESSOR_STATUS_HISTORY_URI_PATTERN.matcher(path).matches()) {
        for (final ProcessorStatusDescriptor descriptor : ProcessorStatusDescriptor.values()) {
            metricDescriptors.put(descriptor.getField(), descriptor.getDescriptor());
        }
    } else if (PROCESS_GROUP_STATUS_HISTORY_URI_PATTERN.matcher(path).matches()) {
        for (final ProcessGroupStatusDescriptor descriptor : ProcessGroupStatusDescriptor.values()) {
            metricDescriptors.put(descriptor.getField(), descriptor.getDescriptor());
        }
    } else if (REMOTE_PROCESS_GROUP_STATUS_HISTORY_URI_PATTERN.matcher(path).matches()) {
        for (final RemoteProcessGroupStatusDescriptor descriptor : RemoteProcessGroupStatusDescriptor.values()) {
            metricDescriptors.put(descriptor.getField(), descriptor.getDescriptor());
        }
    } else if (CONNECTION_STATUS_HISTORY_URI_PATTERN.matcher(path).matches()) {
        for (final ConnectionStatusDescriptor descriptor : ConnectionStatusDescriptor.values()) {
            metricDescriptors.put(descriptor.getField(), descriptor.getDescriptor());
        }
    }
    return metricDescriptors;
}
Also used : ConnectionStatusDescriptor(org.apache.nifi.controller.status.history.ConnectionStatusDescriptor) StandardMetricDescriptor(org.apache.nifi.controller.status.history.StandardMetricDescriptor) MetricDescriptor(org.apache.nifi.controller.status.history.MetricDescriptor) ProcessorStatusDescriptor(org.apache.nifi.controller.status.history.ProcessorStatusDescriptor) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) RemoteProcessGroupStatusDescriptor(org.apache.nifi.controller.status.history.RemoteProcessGroupStatusDescriptor) RemoteProcessGroupStatusDescriptor(org.apache.nifi.controller.status.history.RemoteProcessGroupStatusDescriptor) ProcessGroupStatusDescriptor(org.apache.nifi.controller.status.history.ProcessGroupStatusDescriptor)

Aggregations

HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 ConnectionStatusDescriptor (org.apache.nifi.controller.status.history.ConnectionStatusDescriptor)1 MetricDescriptor (org.apache.nifi.controller.status.history.MetricDescriptor)1 ProcessGroupStatusDescriptor (org.apache.nifi.controller.status.history.ProcessGroupStatusDescriptor)1 ProcessorStatusDescriptor (org.apache.nifi.controller.status.history.ProcessorStatusDescriptor)1 RemoteProcessGroupStatusDescriptor (org.apache.nifi.controller.status.history.RemoteProcessGroupStatusDescriptor)1 StandardMetricDescriptor (org.apache.nifi.controller.status.history.StandardMetricDescriptor)1