Search in sources :

Example 1 with InternalCounters

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());
}
Also used : InternalCounters(com.evolveum.midpoint.schema.internals.InternalCounters)

Example 2 with InternalCounters

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);
}
Also used : ListView(org.apache.wicket.markup.html.list.ListView) InternalCounters(com.evolveum.midpoint.schema.internals.InternalCounters) Label(org.apache.wicket.markup.html.basic.Label) ListItem(org.apache.wicket.markup.html.list.ListItem)

Aggregations

InternalCounters (com.evolveum.midpoint.schema.internals.InternalCounters)2 Label (org.apache.wicket.markup.html.basic.Label)1 ListItem (org.apache.wicket.markup.html.list.ListItem)1 ListView (org.apache.wicket.markup.html.list.ListView)1