woolfel     2004/10/28 16:38:14

  Modified:    src/core/org/apache/jmeter/samplers SampleResult.java
  Log:
  I added two attributes to sampleResult, which may be useful to other

  samplers like the java sampler. the first one is sampleCount in case a

  sampler does a set number of loops within each sample() call. the

  second is bytes length in case a sampler doesn't pass back the contents

  of the response. this allows the aggregate listener to calcuate the rate

  without the cost of passing back the entire response message/result.

  

  peter
  
  Revision  Changes    Path
  1.36      +38 -0     
jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java
  
  Index: SampleResult.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jmeter/src/core/org/apache/jmeter/samplers/SampleResult.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- SampleResult.java 6 Oct 2004 14:43:56 -0000       1.35
  +++ SampleResult.java 28 Oct 2004 23:38:14 -0000      1.36
  @@ -103,6 +103,8 @@
       private boolean stopThread = false; //Should thread terminate?
        private boolean stopTest = false;   //Should test terminate?
        private boolean isMonitor = false;
  +     private int sampleCount = 1;
  +     private int bytes = 0;
        //TODO do contentType and/or dataEncoding belong in HTTPSampleResult instead?
   
       private final static String TOTAL_TIME = "totalTime";
  @@ -651,6 +653,42 @@
         */
        public boolean isMonitor(){
                return isMonitor;
  +     }
  +     
  +     /**
  +      * For the JMS sampler, it can perform multiple samples
  +      * for greater degree of accuracy.
  +      * @param count
  +      */
  +     public void setSampleCount(int count){
  +             sampleCount = count;
  +     }
  +     
  +     /**
  +      * return the sample count. by default, the value is 1.
  +      * @return
  +      */
  +     public int getSampleCount(){
  +             return sampleCount;
  +     }
  +     
  +     /**
  +      * 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.
  +      * @param length
  +      */
  +     public void setBytes(int length){
  +             bytes = length;
  +     }
  +     
  +     /**
  +      * return the bytes returned by the response.
  +      * @return
  +      */
  +     public int getBytes(){
  +             return bytes;
        }
        
   ////////////////////////////// Start of Test Code ///////////////////////////
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to