Hello everyone,
I am using the LatencyUtils package for tracking and reporting on the
behavior of latencies across measurements:

https://github.com/LatencyUtils/LatencyUtils/blob/d8f51f39f6146e1ad9a263dc916bcbc0ec06e16d/src/main/java/org/LatencyUtils/LatencyStats.java#L196

For recording the time by this method, the time unit should be nanosecond,
but in my case the time recorded is in milliseconds. I want to know if
there is a better way to record time in milliseconds?

The solution I use now is to multiply all the recorded time by one million.
But I still hope that the results are in microseconds, so for the results I
get, I divide it by one million.











*public void addValue(Long val, long sampleCount) {    sum += val *
sampleCount;    for (int i = 0; i < sampleCount; i++) {
latencyStats.recordLatency(val*1000000);    }
histogram.add(latencyStats.getIntervalHistogram());    max = Math.max(val,
max);    min = Math.min(val, min);    updateValueCount(val,sampleCount);}*


*public double getStandardDeviation() {    return
histogram.getStdDeviation()/1000000;}*

And about the default constructor of LatencyUtil is like this:
















*private long lowestTrackableLatency = 1000L; /* 1 usec */private long
highestTrackableLatency = 3600000000000L; /* 1 hr */private int
numberOfSignificantValueDigits = 2;private int
intervalEstimatorWindowLength = 1024;private long intervalEstimatorTimeCap
= 10000000000L; /* 10 sec */private PauseDetector pauseDetector =
null;public LatencyStats() {    this(
defaultBuilder.lowestTrackableLatency,
defaultBuilder.highestTrackableLatency,
defaultBuilder.numberOfSignificantValueDigits,
defaultBuilder.intervalEstimatorWindowLength,
defaultBuilder.intervalEstimatorTimeCap,
defaultBuilder.pauseDetector    );}*

So in fact the lowest trackable latency of LatencyUtil is also in
nanosecond, if I put a value in milesecond, I am afraid that will affect
the results of the record.
You can have a look at Work In Progress here:

https://github.com/ubikloadpack/jmeter/pull/50/files#diff-a1a978725579541c3947856efdc40503R254
<https://github.com/ubikloadpack/jmeter/pull/50/files#diff-a1a978725579541c3947856efdc40503R254>


Thanks & Regards.
Qianqian SHA

Reply via email to