Latency utils#50
Conversation
update the version of jmeter
| mySB.append("Max: " + this.getMax() + " "); | ||
| mySB.append("Error Rate: " + this.getErrorPercentage() + " "); | ||
| mySB.append("Sample Rate: " + this.getRate()); | ||
| mySB.append("elapse: " + this.getElapsed()); |
There was a problem hiding this comment.
Modify 'elapse:' to 'elapsed:'
| } | ||
|
|
||
| @Override | ||
| public void clear() { |
There was a problem hiding this comment.
Shouldn't you be clearing/resetting latencyStats ? and also call stop on object to make threads stop ?
| */ | ||
| public class StatisticsSummaryData { | ||
|
|
||
| LatencyStats latencyStats = new LatencyStats(1,3600000000000L,2,1024,10000000000L,null); |
There was a problem hiding this comment.
- Why is PauseDetector null ? We want this feature
- Is the window 1024 big enough ? What is the logic behind ? Make it a configurable property
- intervalEstimatorWindowLength is 10000000000L, What is the logic behind ?
|
|
||
| void addAll(IStatCalculator<T> calc); | ||
|
|
||
| T getMedian(); |
There was a problem hiding this comment.
Document all interface methods
| @Override | ||
| public Map<Number, Number[]> getDistribution() { | ||
| Map<Number, Number[]> result = new HashMap<>(); | ||
| histogram.percentiles(5).forEach(p -> { |
| @@ -0,0 +1,27 @@ | |||
| BSD License | |||
|
|
|||
| Copyright (c) 2000-2015 www.hamcrest.org | |||
There was a problem hiding this comment.
Are you sure HdrHistogram is copyrighted by hamcrest.org?
| @@ -0,0 +1,27 @@ | |||
| BSD License | |||
|
|
|||
| Copyright (c) 2000-2015 www.hamcrest.org | |||
There was a problem hiding this comment.
Are you sure LatencyUtils is copyrighted by hamcrest?
|
|
||
| private LatencyStats latencyStats = LatencyStats.Builder.create().build(); | ||
| Histogram intervalHistogram = latencyStats.getIntervalHistogram(); | ||
| private Histogram histogram = new Histogram(intervalHistogram); |
There was a problem hiding this comment.
What's the precision of the resulting histogram?
What's the memory consumption?
There was a problem hiding this comment.
This is work in progress. See question asked on dev list also
| min = Math.min(val, min); | ||
| updateValueCount(val,1); | ||
| } | ||
| private void updateValueCount(Long actualValue, long sampleCount) { |
There was a problem hiding this comment.
It is a method for calculating distribution, so I try to record the value when it is added . Can you give another idea? Thanks
There was a problem hiding this comment.
What's the purpose of valuesMap?
Histogram / LatencyStats should track the distribution.
There was a problem hiding this comment.
In fact in the old code, the distribution value comes from this method :
public Map<Number, Number[]> getDistribution() {
Map<Number, Number[]> items = new HashMap<>();
for (Entry<T, MutableLong> entry : valuesMap.entrySet()) {
Number[] dis = new Number[2];
dis[0] = entry.getKey();
dis[1] = entry.getValue();
items.put(entry.getKey(), dis);
}
return items;
}
I don't think the LatencyStats can track this distribution
| histogram.recordValue(l*1000000L); | ||
| } | ||
| // test max/min | ||
| assertTrue(10 == statisticsSummaryData.getMax()); |
There was a problem hiding this comment.
Please avoid writing tests like that.
It would be hard to analyze especially at Travis/Jenkins CI.
Please use something like assertEquals(Arrays.toString(values) + ".getMax()", 10, statisticsSummaryData.getMax())
General rule: assertTrue and assertFalse are almost always bad.
| import org.junit.Before; | ||
| import org.junit.Test; | ||
|
|
||
| public class TestHisStatCalculator { |
There was a problem hiding this comment.
his => Histogram
But better use TestHistogramStatCalculator
| calc1.addValue(l); | ||
| } | ||
| calc.addAll(calc1); | ||
| assertTrue(23 == calc.getMax()); |
| * asm-7.0.jar (BSD) | ||
| * dnsjava-2.1.8.jar (BSD) | ||
| * hamcrest-core-1.3.jar (BSD) | ||
| * LatencyUtils-2.0.3.jar (BSD) |
There was a problem hiding this comment.
BSD is an invalid (too broad) license reference. Please use SPDX license ID when possible: https://spdx.org/licenses/
There was a problem hiding this comment.
https://github.com/LatencyUtils/LatencyUtils/blob/master/LICENSE
https://github.com/HdrHistogram/HdrHistogram/blob/master/LICENSE.txt
These two licenses are both in BSD, what can I do to use SPDX License ? Thanks
| # are contained in the JMeter binary release. | ||
|
|
||
| maven2.repo = https://repo1.maven.org/maven2 | ||
| maven.repo = https://repo.maven.apache.org/maven2 |
There was a problem hiding this comment.
AFAIK, LatencyUtils is available in Maven Central. Why do you add maven.repo?
vlsi
left a comment
There was a problem hiding this comment.
I think methods like addSentBytes, addBytes, getTotalBytes, getTotalSentBytes do not belong to a generic IStatCalculator interface, and the methods should be removed from the interface.
| * | ||
| * @param newValue number of newly sent bytes | ||
| */ | ||
| void addSentBytes(long newValue); |
There was a problem hiding this comment.
This looks like a violation of "single responsibility principle".
How getStandardDeviation is related to addSentBytes?
I think methods like addSentBytes, addBytes, getTotalBytes, getTotalSentBytes do not belong to a generic IStatCalculator interface.
There was a problem hiding this comment.
Is "getStandardDeviation" related to sentBytes? In my view the standardDeviation is for the response time of Http Request, and "sent bytes" is for the amount of data used for transmission
| percentile3 = new PercentileAggregator(percentileIndex3); | ||
| mean = new MeanAggregator(); | ||
| public final long getPercentile(double percent) { | ||
| return histogram.getValueAtPercentile(percent)/1000000; |
There was a problem hiding this comment.
This should not be needed as per https://stackoverflow.com/questions/56986503/time-unit-problem-about-latencyutils-recordlatency-method
There was a problem hiding this comment.
The only answer in thie question doesn't give us enough information.
So don't we need to muliple and divide by 1,000,000 each time?
There was a problem hiding this comment.
When the number of Thread is a big number like 1000 -10000, the maximum is bigger than percentile 99%. And IntcountHistogram can also give a correct result.
…e assertTrue to assertEquals
Description
use LatencyUtil to calculate the mean and percentile of datas
How Has This Been Tested?
Yes