use of org.opendaylight.infrautils.counters.impl.service.OccurenceCounterEntry in project infrautils by opendaylight.
the class CountersMain method dumpCounters.
public String dumpCounters(String regex) {
if (regex == null) {
regex = "";
}
Pattern pattern = Pattern.compile(regex);
int sortByColumn = 0;
TablePrinter printer = new TablePrinter(sortByColumn);
printer.setColumnNames("Counter name", "Value");
for (OccurenceCounterEntry entry : countersRunnable.getCounters()) {
String counterName = getCounterFullName(entry.counter.group, entry.counter.name);
Matcher matcher = pattern.matcher(counterName);
if (matcher.find()) {
printer.addRow(counterName, Long.toString(entry.counter.get()));
}
}
return printer.toString();
}
Aggregations