AdminTest.java 文件源码

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

项目:incubator-pulsar 作者:
@Test
void brokerStats() throws Exception {
    doReturn("client-id").when(brokerStats).clientAppId();
    Collection<Metrics> metrics = brokerStats.getMetrics();
    assertNotNull(metrics);
    LocalBrokerData loadReport = (LocalBrokerData) brokerStats.getLoadReport();
    assertNotNull(loadReport);
    assertNotNull(loadReport.getCpu());
    Collection<Metrics> mBeans = brokerStats.getMBeans();
    assertTrue(!mBeans.isEmpty());
    AllocatorStats allocatorStats = brokerStats.getAllocatorStats("default");
    assertNotNull(allocatorStats);
    Map<String, Map<String, PendingBookieOpsStats>> bookieOpsStats = brokerStats.getPendingBookieOpsStats();
    assertTrue(bookieOpsStats.isEmpty());
    StreamingOutput destination = brokerStats.getDestinations2();
    assertNotNull(destination);
    try {
        Map<Long, Collection<ResourceUnit>> resource = brokerStats.getBrokerResourceAvailability("prop", "use",
                "ns2");
        fail("should have failed as ModularLoadManager doesn't support it");
    } catch (RestException re) {
        // Ok
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号