diff --git a/storage/storage.go b/storage/storage.go index 7d521eb0..51f0b9c0 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -33,5 +33,8 @@ type StorageDriver interface { // should return at most numSamples samples. Samples(containername string, numSamples int) ([]*info.ContainerStatsSample, error) + // Close will clear the state of the storage driver. The elements + // stored in the underlying storage may or may not be deleted depending + // on the implementation of the storage driver. Close() error } diff --git a/storage/test/storagetests.go b/storage/test/storagetests.go index ed460705..ec9f5934 100644 --- a/storage/test/storagetests.go +++ b/storage/test/storagetests.go @@ -59,10 +59,8 @@ func StorageDriverTestSampleCpuUsage(driver storage.StorageDriver, t *testing.T) // We need N+1 observations to get N samples for i := 0; i < N+1; i++ { - cpuusage := uint64(rand.Intn(1000)) - memusage := uint64(rand.Intn(1000)) - cpuTrace = append(cpuTrace, cpuusage) - memTrace = append(memTrace, memusage) + cpuTrace = append(cpuTrace, uint64(rand.Intn(1000))) + memTrace = append(memTrace, uint64(rand.Intn(1000))) } samplePeriod := 1 * time.Second