test

package
v0.0.0-...-0003b89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStatsEq

func DefaultStatsEq(a, b *info.ContainerStats) bool

This function is useful because we do not require precise time representation.

func StorageDriverFillRandomStatsFunc

func StorageDriverFillRandomStatsFunc(
	containerName string,
	N int,
	driver TestStorageDriver,
	t *testing.T,
)

This function will generate random stats and write them into the storage. The function will not close the driver

func StorageDriverTestMaxMemoryUsage

func StorageDriverTestMaxMemoryUsage(driver TestStorageDriver, t *testing.T)

func StorageDriverTestNoRecentStats

func StorageDriverTestNoRecentStats(driver TestStorageDriver, t *testing.T)

func StorageDriverTestNoSamples

func StorageDriverTestNoSamples(driver TestStorageDriver, t *testing.T)

func StorageDriverTestPercentiles

func StorageDriverTestPercentiles(driver TestStorageDriver, t *testing.T)

func StorageDriverTestPercentilesWithoutSample

func StorageDriverTestPercentilesWithoutSample(driver TestStorageDriver, t *testing.T)

func StorageDriverTestPercentilesWithoutStats

func StorageDriverTestPercentilesWithoutStats(driver TestStorageDriver, t *testing.T)

func StorageDriverTestRetrieveAllRecentStats

func StorageDriverTestRetrieveAllRecentStats(driver TestStorageDriver, t *testing.T)

func StorageDriverTestRetrievePartialRecentStats

func StorageDriverTestRetrievePartialRecentStats(driver TestStorageDriver, t *testing.T)

func StorageDriverTestRetrieveZeroRecentStats

func StorageDriverTestRetrieveZeroRecentStats(driver TestStorageDriver, t *testing.T)

func StorageDriverTestRetrieveZeroSamples

func StorageDriverTestRetrieveZeroSamples(driver TestStorageDriver, t *testing.T)

func StorageDriverTestSampleCpuUsage

func StorageDriverTestSampleCpuUsage(driver TestStorageDriver, t *testing.T)

func StorageDriverTestSamplesWithoutSample

func StorageDriverTestSamplesWithoutSample(driver TestStorageDriver, t *testing.T)

func TimeEq

func TimeEq(t1, t2 time.Time, tolerance time.Duration) bool

Types

type MockStorageDriver

type MockStorageDriver struct {
	mock.Mock
	MockCloseMethod bool
}

func (*MockStorageDriver) AddStats

func (self *MockStorageDriver) AddStats(ref info.ContainerReference, stats *info.ContainerStats) error

func (*MockStorageDriver) Close

func (self *MockStorageDriver) Close() error

func (*MockStorageDriver) Percentiles

func (self *MockStorageDriver) Percentiles(
	containerName string,
	cpuUsagePercentiles []int,
	memUsagePercentiles []int,
) (*info.ContainerStatsPercentiles, error)

func (*MockStorageDriver) RecentStats

func (self *MockStorageDriver) RecentStats(containerName string, numStats int) ([]*info.ContainerStats, error)

func (*MockStorageDriver) Samples

func (self *MockStorageDriver) Samples(containerName string, numSamples int) ([]*info.ContainerStatsSample, error)

type TestStorageDriver

type TestStorageDriver interface {
	StatsEq(a *info.ContainerStats, b *info.ContainerStats) bool
	storage.StorageDriver
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL