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;
}
Aggregations