Search in sources :

Example 1 with ListTableModel

use of com.evolveum.midpoint.studio.ui.trace.singleOp.model.ListTableModel in project midpoint-studio by Evolveum.

the class OpPerformancePanel method initLayout.

private void initLayout() {
    JBSplitter split = new OnePixelSplitter(false);
    List<TreeTableColumnDefinition<Map.Entry<PerformanceCategory, PerformanceCategoryInfo>, ?>> categoryColumns = new ArrayList<>();
    categoryColumns.add(new TreeTableColumnDefinition<>("Category", 200, o -> o.getKey().getLabel()));
    categoryColumns.add(new TreeTableColumnDefinition<>("Total #", 50, o -> o.getValue().getTotalCount()));
    categoryColumns.add(new TreeTableColumnDefinition<>("Total time", 70, o -> formatTime(o.getValue().getTotalTime())));
    categoryColumns.add(new TreeTableColumnDefinition<>("Own #", 50, o -> o.getValue().getOwnCount()));
    categoryColumns.add(new TreeTableColumnDefinition<>("Own time", 70, o -> formatTime(o.getValue().getOwnTime())));
    this.category = new JBTable(new ListTableModel(categoryColumns, new ArrayList<>()));
    split.setFirstComponent(new JBScrollPane(category));
    List<TreeTableColumnDefinition<SingleOperationPerformanceInformationType, ?>> operationColumns = new ArrayList<>();
    operationColumns.add(new TreeTableColumnDefinition<>("Operation", 500, o -> o.getName()));
    operationColumns.add(new TreeTableColumnDefinition<>("Count", 50, o -> o.getInvocationCount()));
    operationColumns.add(new TreeTableColumnDefinition<>("Total time", 100, o -> formatTime(o.getTotalTime())));
    operationColumns.add(new TreeTableColumnDefinition<>("Min", 50, o -> formatTime(o.getMinTime())));
    operationColumns.add(new TreeTableColumnDefinition<>("Max", 50, o -> formatTime(o.getMaxTime())));
    operationColumns.add(new TreeTableColumnDefinition<>("Avg", 50, o -> formatTime(o.getTotalTime() / o.getInvocationCount())));
    this.operation = new JBTable(new ListTableModel<>(operationColumns, new ArrayList<>()));
    split.setSecondComponent(new JBScrollPane(operation));
    add(split, BorderLayout.CENTER);
}
Also used : MidPointUtils.formatTime(com.evolveum.midpoint.studio.util.MidPointUtils.formatTime) PerformanceCategory(com.evolveum.midpoint.schema.traces.PerformanceCategory) TreeTableColumnDefinition(com.evolveum.midpoint.studio.ui.TreeTableColumnDefinition) MidPointProjectNotifier(com.evolveum.midpoint.studio.impl.MidPointProjectNotifier) JBSplitter(com.intellij.ui.JBSplitter) JBScrollPane(com.intellij.ui.components.JBScrollPane) ArrayList(java.util.ArrayList) OpNode(com.evolveum.midpoint.schema.traces.OpNode) java.awt(java.awt) JBTable(com.intellij.ui.table.JBTable) List(java.util.List) BorderLayoutPanel(com.intellij.util.ui.components.BorderLayoutPanel) SingleOperationPerformanceInformationType(com.evolveum.midpoint.xml.ns._public.common.common_3.SingleOperationPerformanceInformationType) Map(java.util.Map) OnePixelSplitter(com.intellij.ui.OnePixelSplitter) PerformanceCategoryInfo(com.evolveum.midpoint.schema.traces.PerformanceCategoryInfo) Comparator(java.util.Comparator) MessageBus(com.intellij.util.messages.MessageBus) MidPointProjectNotifierAdapter(com.evolveum.midpoint.studio.impl.MidPointProjectNotifierAdapter) ListTableModel(com.evolveum.midpoint.studio.ui.trace.singleOp.model.ListTableModel) TreeTableColumnDefinition(com.evolveum.midpoint.studio.ui.TreeTableColumnDefinition) ArrayList(java.util.ArrayList) PerformanceCategoryInfo(com.evolveum.midpoint.schema.traces.PerformanceCategoryInfo) OnePixelSplitter(com.intellij.ui.OnePixelSplitter) JBTable(com.intellij.ui.table.JBTable) ListTableModel(com.evolveum.midpoint.studio.ui.trace.singleOp.model.ListTableModel) PerformanceCategory(com.evolveum.midpoint.schema.traces.PerformanceCategory) JBSplitter(com.intellij.ui.JBSplitter) Map(java.util.Map) JBScrollPane(com.intellij.ui.components.JBScrollPane)

Aggregations

OpNode (com.evolveum.midpoint.schema.traces.OpNode)1 PerformanceCategory (com.evolveum.midpoint.schema.traces.PerformanceCategory)1 PerformanceCategoryInfo (com.evolveum.midpoint.schema.traces.PerformanceCategoryInfo)1 MidPointProjectNotifier (com.evolveum.midpoint.studio.impl.MidPointProjectNotifier)1 MidPointProjectNotifierAdapter (com.evolveum.midpoint.studio.impl.MidPointProjectNotifierAdapter)1 TreeTableColumnDefinition (com.evolveum.midpoint.studio.ui.TreeTableColumnDefinition)1 ListTableModel (com.evolveum.midpoint.studio.ui.trace.singleOp.model.ListTableModel)1 MidPointUtils.formatTime (com.evolveum.midpoint.studio.util.MidPointUtils.formatTime)1 SingleOperationPerformanceInformationType (com.evolveum.midpoint.xml.ns._public.common.common_3.SingleOperationPerformanceInformationType)1 JBSplitter (com.intellij.ui.JBSplitter)1 OnePixelSplitter (com.intellij.ui.OnePixelSplitter)1 JBScrollPane (com.intellij.ui.components.JBScrollPane)1 JBTable (com.intellij.ui.table.JBTable)1 MessageBus (com.intellij.util.messages.MessageBus)1 BorderLayoutPanel (com.intellij.util.ui.components.BorderLayoutPanel)1 java.awt (java.awt)1 ArrayList (java.util.ArrayList)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Map (java.util.Map)1