Coverage Report - kg.apc.jmeter.perfmon.PerfMonSampleResult
 
Classes in this File Line Coverage Branch Coverage Complexity
PerfMonSampleResult
100%
8/8
N/A
1
 
 1  
 package kg.apc.jmeter.perfmon;
 2  
 
 3  
 import org.apache.jmeter.samplers.SampleResult;
 4  
 
 5  
 public class PerfMonSampleResult
 6  
         extends SampleResult {
 7  
 
 8  
     private final long ts;
 9  
 
 10  6
     public PerfMonSampleResult() {
 11  6
         ts = System.currentTimeMillis();
 12  6
     }
 13  
 
 14  
     // store as responseTime, multiply by 1000 to keep floating precision
 15  
     public void setValue(double value) {
 16  4
         setStartTime(ts);
 17  4
         setEndTime(ts + (long) (value * 1000));
 18  4
     }
 19  
 
 20  
     @Deprecated
 21  
     public double getValue() {
 22  1
         return ((double) getTime()) / 1000d;
 23  
     }
 24  
 
 25  
     //needed for CSV reload as object created by JMeter is not PerfMonSampleResult but SampleResult
 26  
     public static double getValue(SampleResult res) {
 27  2
         return ((double) res.getTime()) / 1000d;
 28  
     }
 29  
 }