storage unit tests
This commit is contained in:
parent
7dd1f031a6
commit
ca65e11486
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user