Class MetricsUtils


  • public class MetricsUtils
    extends Object
    • Method Detail

      • collectKafkaExporterPodsMetrics

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

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

        public static HashMap<String,​String> collectClusterOperatorPodMetrics​(String scraperPodName)
      • 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}