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 podstatic HashMap<String,String>
collectMetricsFromPods(String scraperPodName, io.fabric8.kubernetes.api.model.LabelSelector labelSelector, int port)
Collect metrics from all pods with specific selectorstatic HashMap<String,String>
collectMetricsFromPods(String scraperPodName, io.fabric8.kubernetes.api.model.LabelSelector labelSelector, int port, String metricsPath)
Collect metrics from all pods with specific selectorstatic ArrayList<Double>
collectSpecificMetric(Pattern pattern, HashMap<String,String> data)
Parse out specific metric from whole metrics filestatic 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)
-
-
-
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 namemetricsPath
- 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 metricdata
- 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 scrapedlabelSelector
- pod selectorport
- 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 scrapedlabelSelector
- pod selectorport
- port where metrics are exposedmetricsPath
- additional path where metrics are available- Returns:
- map with metrics {podName, metrics}
-
-