Search in sources :

Example 1 with CountStatistic

use of org.glassfish.external.statistics.CountStatistic in project Payara by payara.

the class JVMStatsImpl method getFirstTreeNodeAsLong.

// @author bnevins
private long getFirstTreeNodeAsLong(TreeNode parent, String NAME) {
    List<TreeNode> nodes = parent.getNodes(NAME);
    if (!nodes.isEmpty()) {
        TreeNode node = nodes.get(0);
        Object val = node.getValue();
        if (val != null) {
            try {
                CountStatistic cs = (CountStatistic) val;
                return cs.getCount();
            } catch (Exception e) {
            // TODO: handle exception
            }
        }
    }
    return 0L;
}
Also used : TreeNode(org.glassfish.flashlight.datatree.TreeNode) CountStatistic(org.glassfish.external.statistics.CountStatistic)

Aggregations

CountStatistic (org.glassfish.external.statistics.CountStatistic)1 TreeNode (org.glassfish.flashlight.datatree.TreeNode)1