APIStatisticsOpenMBean.java 文件源码

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

项目:discoursedb-core 作者:
public synchronized TabularDataSupport getStatistics() {
    TabularDataSupport apiStatisticsTable = new TabularDataSupport(API_STATISTICS_TYPE);

    for (InvocationStatistics methodStats : API_STATISTICS.getInvocationStatistics()) {
        Object[] itemValues = {methodStats.getName(),
                methodStats.getCallCount(),
                methodStats.getErrorCount(),
                methodStats.getTotalTime(),
                methodStats.getAverageTime()};

        try {
            CompositeData result = new CompositeDataSupport(METHOD_STATS_TYPE,
                    ITEM_NAMES,
                    itemValues);
            apiStatisticsTable.put(result);
        } catch (OpenDataException e) {
            throw new RuntimeException(e);
        }

    }

    return apiStatisticsTable;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号