Search in sources :

Example 1 with TextFormat004Parser

use of org.cloudfoundry.promregator.fetcher.TextFormat004Parser in project promregator by promregator.

the class MetricsEndpointTest method testGetMetrics.

@Test
public void testGetMetrics() {
    Assert.assertNotNull(subject);
    String response = subject.getMetrics();
    Assert.assertNotNull(response);
    Assert.assertNotEquals("", response);
    TextFormat004Parser parser = new TextFormat004Parser(response);
    HashMap<String, MetricFamilySamples> mapMFS = parser.parse();
    Assert.assertNotNull(mapMFS.get("metric_unittestapp"));
    Assert.assertNotNull(mapMFS.get("metric_unittestapp2"));
}
Also used : TextFormat004Parser(org.cloudfoundry.promregator.fetcher.TextFormat004Parser) MetricFamilySamples(io.prometheus.client.Collector.MetricFamilySamples) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test)

Aggregations

MetricFamilySamples (io.prometheus.client.Collector.MetricFamilySamples)1 TextFormat004Parser (org.cloudfoundry.promregator.fetcher.TextFormat004Parser)1 Test (org.junit.Test)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1