SiddhiStreamReporterTest.java 文件源码

java
阅读 22 收藏 0 点赞 0 评论 0

项目:Decision 作者:
@Test
public void testReport() throws Exception {
    Clock clock= Clock.defaultClock();

    reporter= builder.convertRatesTo(TimeUnit.MINUTES)
            .convertDurationsTo(TimeUnit.SECONDS)
            .withClock(clock)
            .filter(MetricFilter.ALL)
            .build();

    reporter.start(1, TimeUnit.SECONDS);

    SortedMap<String, Gauge> gauges= new TreeMap<>();
    SortedMap<String, Counter> counters= new TreeMap<>();
    SortedMap<String, Histogram> histograms= new TreeMap<>();
    SortedMap<String, Meter> meters= new TreeMap<>();
    SortedMap<String, Timer> timers= new TreeMap<>();

    Gauge gauge= new FileDescriptorRatioGauge();
    gauges.put("gauges", gauge);

    Counter counter= new Counter();
    counters.put("counters", counter);

    Meter meter= new Meter();
    meters.put("meters", meter);

    Timer timer= new Timer();
    timers.put("timers", timer);

    Exception ex= null;
    try {
        reporter.report(gauges, counters, histograms, meters, timers);
    } catch (Exception e)   {ex= e; }
    assertNull("Expected null value that means not exception", ex);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号