All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kg.apc.jmeter.perfmon.PerfMonSampleResult Maven / Gradle / Ivy

There is a newer version: 2.1
Show newest version
package kg.apc.jmeter.perfmon;

import org.apache.jmeter.samplers.SampleResult;

public class PerfMonSampleResult
        extends SampleResult {

    private final long ts;

    public PerfMonSampleResult() {
        ts = System.currentTimeMillis();
    }

    // store as responseTime, multiply by 1000 to keep floating precision
    public void setValue(double value) {
        setStartTime(ts);
        setEndTime(ts + (long) (value * 1000));
    }

    @Deprecated
    public double getValue() {
        return ((double) getTime()) / 1000d;
    }

    //needed for CSV reload as object created by JMeter is not PerfMonSampleResult but SampleResult
    public static double getValue(SampleResult res) {
        return ((double) res.getTime()) / 1000d;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy