Questions about using hard-coded display of P99 Latency in measurement.getInfo()
Barber0 opened this issue · 1 comments
I noticed that go-ycsb mainly applies cumulative histogram to do the P99 Latency's statistic. Users could set histogram.buckets' interval through properties config.
Though the 'bound' is calculated based on the microsecond latency and configurable 'boundInterval', the code responsible for P99 latency calculation still hardcode 1000 as the bound interval.
If users customize the 'histogram bucket interval' as 1, is it possible to cause display errors? Because the time unit you display on P99 is 'us' (microseconds), 'bound' calculated with interval 1 may represents the real microseconds, after hardcoded calculation, the 'us' you display may represent the 1000 times of the real latency?
https://github.com/pingcap/go-ycsb/blob/master/pkg/measurement/histogram.go
per99 = (bound + 1) * 1000
per99 := 0
per999 := 0
per9999 := 0
opCount := int64(0)
for _, bound := range bounds {
boundCount, _ := h.boundCounts.Get(bound)
opCount += boundCount
per := float64(opCount) / float64(count)
if per99 == 0 && per >= 0.99 {
per99 = (bound + 1) * 1000
}
if per999 == 0 && per >= 0.999 {
per999 = (bound + 1) * 1000
}
if per9999 == 0 && per >= 0.9999 {
per9999 = (bound + 1) * 1000
}
}
Meanwhile, there still isn't binding for Memcached's benchmark, but I want to apply this project on a Memcached benchmark related project.
I have simply added some code for Memcached benchmark for this project. Can you review the PR in this area?