diff --git a/convex-gui/src/main/java/convex/gui/peer/windows/StressPanel.java b/convex-gui/src/main/java/convex/gui/peer/windows/StressPanel.java index 5e61eeca0..c4a7a32be 100644 --- a/convex-gui/src/main/java/convex/gui/peer/windows/StressPanel.java +++ b/convex-gui/src/main/java/convex/gui/peer/windows/StressPanel.java @@ -64,6 +64,7 @@ public class StressPanel extends JPanel { private JCheckBox syncCheckBox; private JCheckBox distCheckBox; private JCheckBox repeatCheckBox; + private JCheckBox queryCheckBox; private JSplitPane splitPane; private JPanel resultPanel; @@ -145,6 +146,11 @@ public StressPanel(Convex peerView) { optionPanel.add(repeatCheckBox); repeatCheckBox.setSelected(false); + optionPanel.add(new JLabel("Query")); + queryCheckBox=new JCheckBox(); + optionPanel.add(queryCheckBox); + queryCheckBox.setSelected(false); + optionPanel.add(new JLabel("Repeat timeout")); repeatTimeSpinner = new JSpinner(); repeatTimeSpinner.setModel(new SpinnerNumberModel(60, 0, 3600, 1)); @@ -259,11 +265,20 @@ protected String doStressRun() throws Exception { ATransaction t = buildTransaction(origin, i); CompletableFuture fr; - if (syncCheckBox.isSelected()) { - Result r=cc.transactSync(t); - fr=CompletableFuture.completedFuture(r); - } else { - fr = cc.transact(t); + if (queryCheckBox.isSelected()) { + if (syncCheckBox.isSelected()) { + Result r=cc.querySync(t); + fr=CompletableFuture.completedFuture(r); + } else { + fr = cc.query(t); + } + } else { + if (syncCheckBox.isSelected()) { + Result r=cc.transactSync(t); + fr=CompletableFuture.completedFuture(r); + } else { + fr = cc.transact(t); + } } synchronized(frs) { // synchronised so we don't collide with other threads