Package io.strimzi.systemtest.utils.specific

## Class MetricsUtils

- java.lang.Object
- - io.strimzi.systemtest.utils.specific.MetricsUtils

-     public class MetricsUtils
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static HashMap<String,​String>` | `collectClusterOperatorPodMetrics​(String scraperPodName)` |
    `static HashMap<String,​String>` | `collectKafkaBridgePodMetrics​(String scraperPodName, String clusterName)` |
    `static HashMap<String,​String>` | `collectKafkaConnectPodsMetrics​(String scraperPodName, String clusterName)` |
    `static HashMap<String,​String>` | `collectKafkaExporterPodsMetrics​(String scraperPodName, String clusterName)` |
    `static HashMap<String,​String>` | `collectKafkaMirrorMaker2PodsMetrics​(String scraperPodName, String clusterName)` |
    `static HashMap<String,​String>` | `collectKafkaPodsMetrics​(String scraperPodName, String clusterName)` |
    `static String` | `collectMetrics​(String scraperPodName, String metricsPodIp, int port, String metricsPath)` | Collect metrics from specific pod
    `static HashMap<String,​String>` | `collectMetricsFromPods​(String scraperPodName, io.fabric8.kubernetes.api.model.LabelSelector labelSelector, int port)` | Collect metrics from all pods with specific selector
    `static HashMap<String,​String>` | `collectMetricsFromPods​(String scraperPodName, io.fabric8.kubernetes.api.model.LabelSelector labelSelector, int port, String metricsPath)` | Collect metrics from all pods with specific selector
    `static ArrayList<Double>` | `collectSpecificMetric​(Pattern pattern, HashMap<String,​String> data)` | Parse out specific metric from whole metrics file
    `static HashMap<String,​String>` | `collectTopicOperatorPodMetrics​(String scraperPodName, String clusterName)` |
    `static HashMap<String,​String>` | `collectUserOperatorPodMetrics​(String scraperPodName, String clusterName)` |
    `static HashMap<String,​String>` | `collectZookeeperPodsMetrics​(String scraperPodName, String clusterName)` |

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### collectMetrics

          public static String collectMetrics​(String scraperPodName,
                                              String metricsPodIp,
                                              int port,
                                              String metricsPath)
                                       throws InterruptedException,
                                              ExecutionException,
                                              IOException

      Collect metrics from specific pod
      Parameters:
        `scraperPodName` - pod name
        `metricsPath` - endpoint where metrics should be available
      Returns:
        collected metrics
      Throws:
        `InterruptedException`
        `ExecutionException`
        `IOException`

    - #### collectKafkaPodsMetrics

          public static HashMap<String,​String> collectKafkaPodsMetrics​(String scraperPodName,
                                                                             String clusterName)

    - #### collectZookeeperPodsMetrics

          public static HashMap<String,​String> collectZookeeperPodsMetrics​(String scraperPodName,
                                                                                 String clusterName)

    - #### collectKafkaConnectPodsMetrics

          public static HashMap<String,​String> collectKafkaConnectPodsMetrics​(String scraperPodName,
                                                                                    String clusterName)

    - #### collectKafkaExporterPodsMetrics

          public static HashMap<String,​String> collectKafkaExporterPodsMetrics​(String scraperPodName,
                                                                                     String clusterName)

    - #### collectKafkaMirrorMaker2PodsMetrics

          public static HashMap<String,​String> collectKafkaMirrorMaker2PodsMetrics​(String scraperPodName,
                                                                                         String clusterName)

    - #### collectUserOperatorPodMetrics

          public static HashMap<String,​String> collectUserOperatorPodMetrics​(String scraperPodName,
                                                                                   String clusterName)

    - #### collectTopicOperatorPodMetrics

          public static HashMap<String,​String> collectTopicOperatorPodMetrics​(String scraperPodName,
                                                                                    String clusterName)

    - #### collectClusterOperatorPodMetrics

          public static HashMap<String,​String> collectClusterOperatorPodMetrics​(String scraperPodName)

    - #### collectKafkaBridgePodMetrics

          public static HashMap<String,​String> collectKafkaBridgePodMetrics​(String scraperPodName,
                                                                                  String clusterName)

    - #### collectSpecificMetric

          public static ArrayList<Double> collectSpecificMetric​(Pattern pattern,
                                                                HashMap<String,​String> data)

      Parse out specific metric from whole metrics file
      Parameters:
        `pattern` - regex pattern for specific metric
        `data` - all metrics data
      Returns:
        list of parsed values

    - #### collectMetricsFromPods

          public static HashMap<String,​String> collectMetricsFromPods​(String scraperPodName,
                                                                            io.fabric8.kubernetes.api.model.LabelSelector labelSelector,
                                                                            int port)

      Collect metrics from all pods with specific selector
      Parameters:
        `scraperPodName` - name of pod from where the metrics will be scraped
        `labelSelector` - pod selector
        `port` - port where metrics are exposed
      Returns:
        map with metrics {podName, metrics}

    - #### collectMetricsFromPods

          public static HashMap<String,​String> collectMetricsFromPods​(String scraperPodName,
                                                                            io.fabric8.kubernetes.api.model.LabelSelector labelSelector,
                                                                            int port,
                                                                            String metricsPath)

      Collect metrics from all pods with specific selector
      Parameters:
        `scraperPodName` - name of pod from where the metrics will be scraped
        `labelSelector` - pod selector
        `port` - port where metrics are exposed
        `metricsPath` - additional path where metrics are available
      Returns:
        map with metrics {podName, metrics}