use of com.evolveum.midpoint.schema.internals.InternalCounters in project midpoint by Evolveum.
the class AbstractIntegrationTest method displayCounters.
protected void displayCounters(InternalCounters... counters) {
StringBuilder sb = new StringBuilder();
for (InternalCounters counter : counters) {
sb.append(" ").append(counter.getLabel()).append(": ").append("+").append(getCounterIncrement(counter)).append(" (").append(InternalMonitor.getCount(counter)).append(")").append("\n");
}
displayValue("Counters", sb.toString());
}
use of com.evolveum.midpoint.schema.internals.InternalCounters in project midpoint by Evolveum.
the class InternalsCountersPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
setOutputMarkupId(true);
Label thresholdCounter = new Label(ID_THRESHOLD_COUNTER, createStringResource("InternalsCountersPanel.thresholds"));
add(thresholdCounter);
ListView<InternalCounters> countersTable = new ListView<>(ID_COUNTERS_TABLE, Arrays.asList(InternalCounters.values())) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<InternalCounters> item) {
InternalCounters counter = item.getModelObject();
Label label = new Label(ID_COUNTER_LABEL, createStringResource("InternalCounters." + counter.getKey()));
item.add(label);
Label valueLabel = new Label(ID_COUNTER_VALUE, new IModel<String>() {
private static final long serialVersionUID = 1L;
@Override
public String getObject() {
long val = InternalMonitor.getCount(counter);
return Long.toString(val);
}
});
item.add(valueLabel);
}
};
add(countersTable);
}
Aggregations