jsalvata 2003/12/01 16:55:33
Modified: src/protocol/http/org/apache/jmeter/protocol/http/proxy
ProxyControl.java
xdocs/usermanual component_reference.xml
src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui
ProxyControlGui.java
Log:
Implement "record only 1st sample in each group" option + GUI improvement.
Revision Changes Path
1.39 +13 -3
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java
Index: ProxyControl.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/ProxyControl.java,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- ProxyControl.java 2 Dec 2003 00:26:07 -0000 1.38
+++ ProxyControl.java 2 Dec 2003 00:55:33 -0000 1.39
@@ -122,9 +122,9 @@
public static final int GROUPING_NO_GROUPS = 0;
public static final int GROUPING_ADD_SEPARATORS = 1;
- // TODO: implement these two:
+ // TODO: implement thin one:
//public static final int GROUPING_IN_CONTROLLERS = 2;
- //public static final int GROUPING_STORE_FIRST_ONLY = 3;
+ public static final int GROUPING_STORE_FIRST_ONLY = 3;
private long lastTime = 0;//When was the last sample seen?
private static final long sampleGap =
@@ -445,6 +445,16 @@
}
lastTime = System.currentTimeMillis();
+ if (groupingMode==GROUPING_STORE_FIRST_ONLY)
+ {
+ if (!firstInBatch) return; // Huh! don't store this one!
+
+ // If we're not storing subsequent samplers, we'll need the
+ // first sampler to do all the work...:
+ sampler.setFollowRedirects(true);
+ sampler.setImageParser(true);
+ }
+
JMeterTreeNode newNode =
treeModel.addComponent(sampler, target);
1.63 +10 -3 jakarta-jmeter/xdocs/usermanual/component_reference.xml
Index: component_reference.xml
===================================================================
RCS file: /home/cvs/jakarta-jmeter/xdocs/usermanual/component_reference.xml,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -r1.62 -r1.63
--- component_reference.xml 2 Dec 2003 00:26:07 -0000 1.62
+++ component_reference.xml 2 Dec 2003 00:55:33 -0000 1.63
@@ -929,8 +929,15 @@
<property name="Port" required="Yes">The port that the Proxy Server listens
to. 8080 is the default, but you can change it
<!--TODO: there's some undocumented flags here -->
<property name="Target Controller" required="Yes">The controller where the
proxy will store the generated samples. By default, it will look for a Recording
Controller and store them there wherever it is.</property>
- <property name="Grouping" required="Yes">Whether to group samplers for
requests received without significant time separation.</property>
- <!-- TODO: describe all available gruping modes -->
+ <property name="Grouping" required="Yes">Whether to group samplers for
requests received without significant time separation, and how to represent that
grouping in the recording:
+ <ul>
+ <li>Do not group samplers: store all recorded samplers sequentially.
+ <li>Add separators between groups: add a controller named
"--------------" to create a visual separation between the groups. Otherwise the
samplers are all stored sequentially.
+ <li>Put each group in a new controller: create a new <complink
name="Simple Controller"/> for each group, and store all samplers for that group in it.
+ <li>Store 1st sampler of each group only: only the first request in
each group will be recorded. The "Follow Redirects" and "Retrieve All Embedded
Resources..." flags will be turned on in those samplers.
+ </ul>
+ </property>
+ <!-- TODO:property name="Group Separation Interval">Inactivity time between
two requests needed to consider them in two separate groups.</property-->
<property name="Patterns to Include" required="No">Regular expressions that
are matched against the full URL that is sampled. Allows filtering of requests that
are recorded. All requests pass through, but only
those that meet the requirements of the Include/Exclude fields are
<i>recorded</i>. If both Include and Exclude are
left empty, then everything is recorded (which can result in dozens of
samples recorded for each page, as images, stylesheets,
1.31 +17 -8
jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java
Index: ProxyControlGui.java
===================================================================
RCS file:
/home/cvs/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/proxy/gui/ProxyControlGui.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ProxyControlGui.java 2 Dec 2003 00:26:07 -0000 1.30
+++ ProxyControlGui.java 2 Dec 2003 00:55:33 -0000 1.31
@@ -457,12 +457,14 @@
JPanel mainPanel = new JPanel(new BorderLayout());
- Box portTargetPanel = Box.createVerticalBox();
- portTargetPanel.add(createPortPanel());
- portTargetPanel.add(Box.createVerticalStrut(5));
- portTargetPanel.add(createTargetPanel());
- portTargetPanel.add(Box.createVerticalStrut(5));
- mainPanel.add(portTargetPanel, BorderLayout.NORTH);
+ Box myBox = Box.createVerticalBox();
+ myBox.add(createPortPanel());
+ myBox.add(Box.createVerticalStrut(5));
+ myBox.add(createTargetPanel());
+ myBox.add(Box.createVerticalStrut(5));
+ myBox.add(createGroupingPanel());
+ myBox.add(Box.createVerticalStrut(5));
+ mainPanel.add(myBox, BorderLayout.NORTH);
Box includeExcludePanel = Box.createVerticalBox();
includeExcludePanel.add(createIncludePanel());
@@ -573,13 +575,19 @@
// This should never happen -- throw an Error:
throw new Error(e);
}
+
+ return panel;
+ }
+ private JPanel createGroupingPanel()
+ {
DefaultComboBoxModel m= new DefaultComboBoxModel();
m.addElement(JMeterUtils.getResString("grouping_no_groups"));
m.addElement(JMeterUtils.getResString("grouping_add_separators"));
// TODO: enable when implemented:
//m.addElement(JMeterUtils.getResString("grouping_in_controllers"));
- //m.addElement(JMeterUtils.getResString("grouping_store_first_only"));
+ m.addElement("[not implemented]");
+ m.addElement(JMeterUtils.getResString("grouping_store_first_only"));
groupingMode = new JComboBox(m);
groupingMode.setName(ProxyControl.GROUPING_MODE);
groupingMode.setSelectedIndex(0);
@@ -589,6 +597,7 @@
JLabel label2 = new JLabel(JMeterUtils.getResString("grouping_mode"));
label2.setLabelFor(groupingMode);
+ HorizontalPanel panel = new HorizontalPanel();
panel.add(label2);
panel.add(groupingMode);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]