This commit is contained in:
Nan Deng 2014-07-07 16:10:09 -07:00
parent a1cb5bf4ef
commit a96e4e12e2
3 changed files with 5 additions and 5 deletions

View File

@ -420,7 +420,7 @@ func (self *influxdbStorage) Percentiles(
if err != nil {
return nil, fmt.Errorf("invalid max memory usage: %v", err)
}
retrievedCpuPercentiles := point[2:]
retrievedCpuPercentiles := point[2 : 2+len(cpuUsagePercentiles)]
for i, p := range cpuUsagePercentiles {
v, err := convertToUint64(retrievedCpuPercentiles[i])
if err != nil {

View File

@ -62,7 +62,7 @@ func runStorageTest(f func(storage.StorageDriver, *testing.T), t *testing.T) {
t.Fatal(err)
}
// delete all data by the end of the call
// defer client.Query(deleteAll)
defer client.Query(deleteAll)
driver, err := New(machineName,
tablename,

View File

@ -59,7 +59,7 @@ func timeEq(t1, t2 time.Time, tolerance time.Duration) bool {
t1, t2 = t2, t1
}
diff := t2.Sub(t1)
if diff < tolerance {
if diff <= tolerance {
return true
}
return false
@ -70,7 +70,7 @@ func durationEq(a, b time.Duration, tolerance time.Duration) bool {
a, b = b, a
}
diff := a - b
if diff < tolerance {
if diff <= tolerance {
return true
}
return false
@ -78,7 +78,7 @@ func durationEq(a, b time.Duration, tolerance time.Duration) bool {
const (
// 10ms, i.e. 0.01s
timePrecision time.Duration = 10000000
timePrecision time.Duration = 10 * time.Millisecond
)
// This function is useful because we do not require precise time