From dbb48c32e7b08aa609eca3cbddecf9c4bdb0e933 Mon Sep 17 00:00:00 2001 From: sasile Date: Thu, 17 May 2018 14:48:48 +0300 Subject: [PATCH] fix sort of latency --- httpblaster/histogram/latency_hist.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/httpblaster/histogram/latency_hist.go b/httpblaster/histogram/latency_hist.go index 5a97aac..67b4c07 100644 --- a/httpblaster/histogram/latency_hist.go +++ b/httpblaster/histogram/latency_hist.go @@ -49,15 +49,15 @@ func (self *LatencyHist) GetResults() ([]string, []float64) { keys = append(keys, k) } sort.Ints(keys) - log.Debugln("latency hist wait released") res_strings := [] string{} - res_values := []float64{} - for k := range keys{ + res_values := [] float64{} + for _,k := range keys{ v := self.hist[k] res_strings = append(res_strings, fmt.Sprintf("%5d - %5d", k*100, (k+1)*100) ) - res_values = append(res_values,float64(v * 100) / float64(self.count)) + value := float64(v * 100) / float64(self.count) + res_values = append(res_values,value) } return res_strings, res_values }