Java Doc for SampleResult.java in  » Testing » jakarta-jmeter » org » apache » jmeter » samplers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » jakarta jmeter » org.apache.jmeter.samplers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.jmeter.samplers.SampleResult

All known Subclasses:   org.apache.jmeter.protocol.http.sampler.HTTPSampleResult,  org.apache.jmeter.samplers.StatisticalSampleResult,
SampleResult
public class SampleResult implements Serializable(Code)
This is a nice packaging for the various information returned from taking a sample of an entry.


Field Summary
final public static  StringBINARY
     Data type value indicating that the response data is binary.
final static  StringDEFAULT_ENCODING
    
final public static  StringDEFAULT_HTTP_ENCODING
    
final public static  StringTEXT
     Data type value indicating that the response data is text.
final static  Loggerlog
    

Constructor Summary
public  SampleResult()
    
public  SampleResult(SampleResult res)
    
protected  SampleResult(long elapsed, boolean atend)
    
public  SampleResult(long stamp, long elapsed)
    

Method Summary
public  voidaddAssertionResult(AssertionResult assertResult)
    
public  voidaddSubResult(SampleResult subResult)
    
public  voidconfigure(Configuration info)
    
public static  SampleResultcreateTestSample(long start, long end)
    
public static  SampleResultcreateTestSample(long elapsed)
    
public  intgetAllThreads()
    
public  AssertionResult[]getAssertionResults()
     Gets the assertion results associated with this sample.
public  intgetBytes()
     return the bytes returned by the response.
public  StringgetContentType()
     the full content type - e.g.
public  StringgetDataEncoding()
    
public  StringgetDataEncodingNoDefault()
    
public  StringgetDataEncodingWithDefault()
    
public  StringgetDataType()
    
public  longgetEndTime()
    
public  intgetErrorCount()
     Returns the count of errors.
public  intgetGroupThreads()
    
public  longgetIdleTime()
    
public  longgetLatency()
    
public  StringgetMediaType()
     Get the media type from the Content Type the media type - e.g.
public  SampleResultgetParent()
    
public  StringgetRequestHeaders()
    
public  StringgetResponseCode()
    
public  byte[]getResponseData()
     Gets the responseData attribute of the SampleResult object.
public  StringgetResponseDataAsString()
    
public  StringgetResponseHeaders()
    
public  StringgetResponseMessage()
    
public  StringgetResultFileName()
    
public  intgetSampleCount()
     return the sample count.
public  StringgetSampleLabel()
    
public  StringgetSamplerData()
    
public  SampleSaveConfigurationgetSaveConfig()
    
public  longgetStartTime()
    
public  SampleResult[]getSubResults()
     Gets the subresults associated with this sample. an array containing the subresults for this sample.
public  StringgetThreadName()
    
public  longgetTime()
     Get the time it took this sample to occur.
public  longgetTimeStamp()
     Get the sample timestamp, which may be either the start time or the end time.
public  URLgetURL()
    
public  StringgetUrlAsString()
     Get a String representation of the URL (if defined).
public  booleanisMarked(String filename)
    
public  booleanisMonitor()
     If the sampler is a monitor, method will return true.
public  booleanisResponseCodeOK()
    
public  booleanisStampedAtStart()
    
public  booleanisStopTest()
    
public  booleanisStopThread()
    
public  booleanisSuccessful()
    
public  voidlatencyEnd()
    
public  voidsampleEnd()
    
public  voidsamplePause()
    
public  voidsampleResume()
    
public  voidsampleStart()
    
public  voidsetAllThreads(int n)
    
public  voidsetBytes(int length)
     In the event the sampler does want to pass back the actual contents, we still want to calculate the throughput.
public  voidsetContentType(String string)
    
public  voidsetDataEncoding(String dataEncoding)
     Sets the dataEncoding.
Parameters:
  dataEncoding - the dataEncoding to set, e.g.
public  voidsetDataType(String dataType)
    
public  voidsetEncodingAndType(String ct)
    
protected  voidsetEndTime(long end)
    
public  voidsetErrorCount(int i)
    
public  voidsetGroupThreads(int n)
    
public  voidsetLatency(long latency)
    
public  voidsetMarked(String filename)
    
public  voidsetMonitor(boolean monitor)
    
public  voidsetParent(SampleResult parent)
    
public  voidsetRequestHeaders(String string)
    
public  voidsetResponseCode(String code)
    
public  voidsetResponseCodeOK()
     Set response code to OK, i.e.
public  voidsetResponseData(byte[] response)
     Sets the responseData attribute of the SampleResult object.
public  voidsetResponseData(String response)
     Sets the responseData attribute of the SampleResult object.
public  voidsetResponseHeaders(String string)
    
public  voidsetResponseMessage(String msg)
    
public  voidsetResponseMessageOK()
    
public  voidsetResultFileName(String resultFileName)
    
public  voidsetSampleCount(int count)
     For the JMS sampler, it can perform multiple samples for greater degree of accuracy.
public  voidsetSampleLabel(String label)
    
public  voidsetSamplerData(String s)
    
public  voidsetSaveConfig(SampleSaveConfiguration propertiesToSave)
    
public  voidsetStampAndTime(long stamp, long elapsed)
    
final protected  voidsetStartTime(long start)
    
public  voidsetStopTest(boolean b)
    
public  voidsetStopThread(boolean b)
    
public  voidsetSuccessful(boolean success)
     Sets the successful attribute of the SampleResult object.
public  voidsetThreadName(String threadName)
    
public  voidsetTime(long elapsed)
     Method to set the elapsed time for a sample.
public  voidsetTimeStamp(long timeStamp)
    
public  voidsetURL(URL location)
    
public  voidstoreSubResult(SampleResult subResult)
     Add a subresult read from a results file.
public  StringtoString()
     Returns the display name.

Field Detail
BINARY
final public static String BINARY(Code)
Data type value indicating that the response data is binary.
See Also:   SampleResult.getDataType
See Also:   SampleResult.setDataType(java.lang.String)



DEFAULT_ENCODING
final static String DEFAULT_ENCODING(Code)



DEFAULT_HTTP_ENCODING
final public static String DEFAULT_HTTP_ENCODING(Code)



TEXT
final public static String TEXT(Code)
Data type value indicating that the response data is text.
See Also:   SampleResult.getDataType
See Also:   SampleResult.setDataType(java.lang.String)



log
final static Logger log(Code)




Constructor Detail
SampleResult
public SampleResult()(Code)



SampleResult
public SampleResult(SampleResult res)(Code)
Construct a 'parent' result for an already-existing result, essentially cloning it
Parameters:
  res - existing sample result



SampleResult
protected SampleResult(long elapsed, boolean atend)(Code)
Create a sample with a specific elapsed time but don't allow the times to be changed later (only used by HTTPSampleResult)
Parameters:
  elapsed - time
Parameters:
  atend - create the sample finishing now, else starting now



SampleResult
public SampleResult(long stamp, long elapsed)(Code)
Allow users to create a sample with specific timestamp and elapsed times for cloning purposes, but don't allow the times to be changed later Currently used by OldSaveService, CSVSaveService and StatisticalSampleResult
Parameters:
  stamp - -this may be a start time or an end time
Parameters:
  elapsed -




Method Detail
addAssertionResult
public void addAssertionResult(AssertionResult assertResult)(Code)



addSubResult
public void addSubResult(SampleResult subResult)(Code)



configure
public void configure(Configuration info)(Code)



createTestSample
public static SampleResult createTestSample(long start, long end)(Code)
Create a sample with specific start and end times for test purposes, but don't allow the times to be changed later (used by StatVisualizerModel.Test)
Parameters:
  start - start time
Parameters:
  end - end time



createTestSample
public static SampleResult createTestSample(long elapsed)(Code)
Create a sample with a specific elapsed time for test purposes, but don't allow the times to be changed later
Parameters:
  elapsed - -desired elapsed time



getAllThreads
public int getAllThreads()(Code)



getAssertionResults
public AssertionResult[] getAssertionResults()(Code)
Gets the assertion results associated with this sample. an array containing the assertion results for this sample.Returns empty array if there are no assertion results.



getBytes
public int getBytes()(Code)
return the bytes returned by the response. byte count



getContentType
public String getContentType()(Code)
the full content type - e.g. text/html [;charset=utf-8 ]



getDataEncoding
public String getDataEncoding()(Code)
Returns the dataEncoding or the default if no dataEncoding was provided



getDataEncodingNoDefault
public String getDataEncodingNoDefault()(Code)
Returns the dataEncoding or the default if no dataEncoding was provided



getDataEncodingWithDefault
public String getDataEncodingWithDefault()(Code)
Returns the dataEncoding or the default if no dataEncoding was provided



getDataType
public String getDataType()(Code)



getEndTime
public long getEndTime()(Code)
the end time



getErrorCount
public int getErrorCount()(Code)
Returns the count of errors. 0 - or 1 if the sample failed



getGroupThreads
public int getGroupThreads()(Code)



getIdleTime
public long getIdleTime()(Code)
idleTime



getLatency
public long getLatency()(Code)
Returns the latency.



getMediaType
public String getMediaType()(Code)
Get the media type from the Content Type the media type - e.g. text/html (without charset, if any)



getParent
public SampleResult getParent()(Code)
Returns the parent.



getRequestHeaders
public String getRequestHeaders()(Code)
the request headers



getResponseCode
public String getResponseCode()(Code)



getResponseData
public byte[] getResponseData()(Code)
Gets the responseData attribute of the SampleResult object. the responseData value (cannot be null)



getResponseDataAsString
public String getResponseDataAsString()(Code)
Gets the responseData of the SampleResult object as a String the responseData value as a String, converted according to the encoding



getResponseHeaders
public String getResponseHeaders()(Code)
the response headers



getResponseMessage
public String getResponseMessage()(Code)



getResultFileName
public String getResultFileName()(Code)



getSampleCount
public int getSampleCount()(Code)
return the sample count. by default, the value is 1. the sample count



getSampleLabel
public String getSampleLabel()(Code)



getSamplerData
public String getSamplerData()(Code)



getSaveConfig
public SampleSaveConfiguration getSaveConfig()(Code)



getStartTime
public long getStartTime()(Code)
the start time



getSubResults
public SampleResult[] getSubResults()(Code)
Gets the subresults associated with this sample. an array containing the subresults for this sample. Returns anempty array if there are no subresults.



getThreadName
public String getThreadName()(Code)



getTime
public long getTime()(Code)
Get the time it took this sample to occur. elapsed time in milliseonds



getTimeStamp
public long getTimeStamp()(Code)
Get the sample timestamp, which may be either the start time or the end time.
See Also:   SampleResult.getStartTime()
See Also:   SampleResult.getEndTime() timeStamp in milliseconds



getURL
public URL getURL()(Code)



getUrlAsString
public String getUrlAsString()(Code)
Get a String representation of the URL (if defined). ExternalForm of URL, or empty string if url is null



isMarked
public boolean isMarked(String filename)(Code)



isMonitor
public boolean isMonitor()(Code)
If the sampler is a monitor, method will return true. true if the sampler is a monitor



isResponseCodeOK
public boolean isResponseCodeOK()(Code)



isStampedAtStart
public boolean isStampedAtStart()(Code)



isStopTest
public boolean isStopTest()(Code)
whether to stop the test



isStopThread
public boolean isStopThread()(Code)
whether to stop this thread



isSuccessful
public boolean isSuccessful()(Code)



latencyEnd
public void latencyEnd()(Code)
Set the time to the first response



sampleEnd
public void sampleEnd()(Code)
Record the end time of a sample and calculate the elapsed time



samplePause
public void samplePause()(Code)
Pause a sample



sampleResume
public void sampleResume()(Code)
Resume a sample



sampleStart
public void sampleStart()(Code)
Record the start time of a sample



setAllThreads
public void setAllThreads(int n)(Code)



setBytes
public void setBytes(int length)(Code)
In the event the sampler does want to pass back the actual contents, we still want to calculate the throughput. The bytes is the bytes of the response data.
Parameters:
  length -



setContentType
public void setContentType(String string)(Code)

Parameters:
  string -



setDataEncoding
public void setDataEncoding(String dataEncoding)(Code)
Sets the dataEncoding.
Parameters:
  dataEncoding - the dataEncoding to set, e.g. ISO-8895-1, UTF-8



setDataType
public void setDataType(String dataType)(Code)



setEncodingAndType
public void setEncodingAndType(String ct)(Code)
Set Encoding and DataType from ContentType
Parameters:
  ct - - content type (may be null)



setEndTime
protected void setEndTime(long end)(Code)



setErrorCount
public void setErrorCount(int i)(Code)



setGroupThreads
public void setGroupThreads(int n)(Code)



setLatency
public void setLatency(long latency)(Code)
This is only intended for use by SampleResultConverter!
Parameters:
  latency - The latency to set.



setMarked
public void setMarked(String filename)(Code)



setMonitor
public void setMonitor(boolean monitor)(Code)
When a Sampler is working as a monitor
Parameters:
  monitor -



setParent
public void setParent(SampleResult parent)(Code)

Parameters:
  parent - The parent to set.



setRequestHeaders
public void setRequestHeaders(String string)(Code)

Parameters:
  string - -request headers



setResponseCode
public void setResponseCode(String code)(Code)



setResponseCodeOK
public void setResponseCodeOK()(Code)
Set response code to OK, i.e. "200"



setResponseData
public void setResponseData(byte[] response)(Code)
Sets the responseData attribute of the SampleResult object. If the parameter is null, then the responseData is set to an empty byte array. This ensures that getResponseData() can never be null.
Parameters:
  response - the new responseData value



setResponseData
public void setResponseData(String response)(Code)
Sets the responseData attribute of the SampleResult object.
Parameters:
  response - the new responseData value (String)



setResponseHeaders
public void setResponseHeaders(String string)(Code)

Parameters:
  string - -response headers



setResponseMessage
public void setResponseMessage(String msg)(Code)



setResponseMessageOK
public void setResponseMessageOK()(Code)



setResultFileName
public void setResultFileName(String resultFileName)(Code)



setSampleCount
public void setSampleCount(int count)(Code)
For the JMS sampler, it can perform multiple samples for greater degree of accuracy.
Parameters:
  count -



setSampleLabel
public void setSampleLabel(String label)(Code)



setSamplerData
public void setSamplerData(String s)(Code)



setSaveConfig
public void setSaveConfig(SampleSaveConfiguration propertiesToSave)(Code)

Parameters:
  propertiesToSave - The propertiesToSave to set.



setStampAndTime
public void setStampAndTime(long stamp, long elapsed)(Code)



setStartTime
final protected void setStartTime(long start)(Code)



setStopTest
public void setStopTest(boolean b)(Code)

Parameters:
  b -



setStopThread
public void setStopThread(boolean b)(Code)

Parameters:
  b -



setSuccessful
public void setSuccessful(boolean success)(Code)
Sets the successful attribute of the SampleResult object.
Parameters:
  success - the new successful value



setThreadName
public void setThreadName(String threadName)(Code)



setTime
public void setTime(long elapsed)(Code)
Method to set the elapsed time for a sample. Retained for backward compatibility with 3rd party add-ons. It is assumed that the method is only called at the end of a sample and that timeStamps are end-times Also used by SampleResultConverter when creating results from files. Must not be used in conjunction with sampleStart()/End()
Parameters:
  elapsed - time in milliseconds



setTimeStamp
public void setTimeStamp(long timeStamp)(Code)
This is only intended for use by SampleResultConverter!
Parameters:
  timeStamp - The timeStamp to set.



setURL
public void setURL(URL location)(Code)



storeSubResult
public void storeSubResult(SampleResult subResult)(Code)
Add a subresult read from a results file. As for addSubResult(), except that the fields don't need to be accumulated
Parameters:
  subResult -



toString
public String toString()(Code)
Returns the display name. display name of this sample result



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.