|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jmeter.protocol.http.util.accesslog.StandardGenerator
Description:
StandardGenerator will be the default generator used
to pre-process logs. It uses JMeter classes to
generate the .jmx file. The first version of the
utility only generated the HTTP requests as XML, but
it required users to copy and paste it into a blank
jmx file. Doing that way isn't flexible and would
require changes to keep the format in sync.
This version is a completely new class with a totally different implementation, since generating the XML is no longer handled by the generator. The generator is only responsible for handling the parsed results and passing it to the appropriate JMeter class.
Notes:
the class needs to first create a thread group and
add it to the HashTree. Then the samplers should
be added to the thread group. Listeners shouldn't
be added and should be left up to the user. One
option is to provide parameters, so the user can
pass the desired listener to the tool.
Field Summary | |
protected File |
FILE
|
protected String |
FILENAME
|
protected OutputStream |
OUTPUT
|
protected HTTPSampler |
SAMPLE
|
protected FileWriter |
WRITER
|
Constructor Summary | |
StandardGenerator()
The constructor is used by GUI and samplers to generate request objects. |
|
StandardGenerator(String file)
|
Method Summary | |
void |
close()
close the generator |
Object |
generateRequest()
The method is responsible for calling the necessary methods to generate a valid request. |
protected void |
init()
initialize the generator. |
protected void |
initStream()
Create the FileWriter to save the JMX file. |
void |
reset()
Reset the HTTPSampler to make sure it is a new instance. |
void |
save()
save must be called to write the jmx file, otherwise it will not be saved. |
void |
setHost(String host)
The host is the name of the server. |
void |
setLabel(String label)
This is the label for the request, which is used in the logs and results. |
void |
setMethod(String post_get)
The method is the HTTP request method. |
void |
setParams(NVPair[] params)
Set the request parameters |
void |
setPath(String path)
The path is the web page you want to test. |
void |
setPort(int port)
The default port for HTTP is 80, but not all servers run on that port. |
void |
setQueryString(String querystring)
Set the querystring for the request if the method is GET. |
void |
setSourceLogs(String sourcefile)
The source logs is the location where the access log resides. |
void |
setTarget(Object target)
The target can be either a java.io.File or a Sampler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected HTTPSampler SAMPLE
protected transient FileWriter WRITER
protected transient OutputStream OUTPUT
protected String FILENAME
protected File FILE
Constructor Detail |
public StandardGenerator()
public StandardGenerator(String file)
file
- Method Detail |
protected void init()
protected void initStream()
public void close()
Generator
close
in interface Generator
public void setHost(String host)
Generator
setHost
in interface Generator
host
- public void setLabel(String label)
Generator
setLabel
in interface Generator
label
- public void setMethod(String post_get)
Generator
setMethod
in interface Generator
post_get
- public void setParams(NVPair[] params)
Generator
setParams
in interface Generator
params
- public void setPath(String path)
Generator
setPath
in interface Generator
path
- public void setPort(int port)
Generator
setPort
in interface Generator
port
- - port numberpublic void setQueryString(String querystring)
Generator
setQueryString
in interface Generator
querystring
- public void setSourceLogs(String sourcefile)
Generator
setSourceLogs
in interface Generator
sourcefile
- public void setTarget(Object target)
Generator
setTarget
in interface Generator
target
- public Object generateRequest()
Generator
generateRequest
in interface Generator
public void save()
save
in interface Generator
public void reset()
reset
in interface Generator
|
Apache JMeter 2.0.1.20050615 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |