mock

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0, BSD-3-Clause, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockStatStore

func NewMockStatStore(common *MockCommonStore, cgroup *MockCgroupStore) statestore.StateStore

NewMockStatStore create fake resource stats instance

Types

type MockCgroupStore

type MockCgroupStore struct {
	CgStats  map[string]*cgroupstore.CgroupStats
	ExtraCgs []string
}

MockCgroupStore mock cgroup resource store. Functions are now panic if not used in testing, and you need to implement the codes when using.

func (*MockCgroupStore) AddExtraCgroups

func (cg *MockCgroupStore) AddExtraCgroups(extraCgs []string) error

mock function

func (*MockCgroupStore) GetCgroupResourceRangeStats

func (cg *MockCgroupStore) GetCgroupResourceRangeStats(podName, podNamespace string, start, end time.Time,
	count int) ([]*cgroupstore.CgroupStats, error)

mock function

func (*MockCgroupStore) GetCgroupResourceRecentState

func (cg *MockCgroupStore) GetCgroupResourceRecentState(podName, podNamespace string,
	updateStats bool) (*cgroupstore.CgroupStats, error)

mock function

func (*MockCgroupStore) GetCgroupResourceRecentStateByPath

func (cg *MockCgroupStore) GetCgroupResourceRecentStateByPath(cgPath string,
	updateStats bool) (*cgroupstore.CgroupStats, error)

mock function

func (*MockCgroupStore) GetCgroupStoreSupportedTags

func (cg *MockCgroupStore) GetCgroupStoreSupportedTags() []string

mock function

func (*MockCgroupStore) ListAllCgroups

func (cg *MockCgroupStore) ListAllCgroups(classFilter sets.String) (map[string]*cgroupstore.CgroupRef, error)

mock function

func (*MockCgroupStore) ListCgroupResourceRangeStats

func (cg *MockCgroupStore) ListCgroupResourceRangeStats(start, end time.Time, count int,
	classFilter sets.String) (map[string][]*cgroupstore.CgroupStats, error)

mock function

func (*MockCgroupStore) ListCgroupResourceRecentState

func (cg *MockCgroupStore) ListCgroupResourceRecentState(updateStats bool,
	classFilter sets.String) (map[string]*cgroupstore.CgroupStats, error)

mock function

func (*MockCgroupStore) MachineInfo

func (cg *MockCgroupStore) MachineInfo() (*cadvisorapi.MachineInfo, error)

mock function

type MockCommonStore

MockCommonStore mock common resource stat store

type MockCustomizeStore

type MockCustomizeStore struct {
	customizestore.StoreInterfaceForTest
}

MockCustomizeStore mock customize resource store

func NewMockCustomizeStore

func NewMockCustomizeStore() *MockCustomizeStore

NewMockCustomizeStore create a customize store mock instance

type MockNodeStore

type MockNodeStore struct {
	Resources []*nodestore.NodeResourceState
}

MockNodeStore mock node resource store

func (*MockNodeStore) GetNodeResourceRangeStats

func (n *MockNodeStore) GetNodeResourceRangeStats(start, end time.Time, count int) (
	[]*nodestore.NodeResourceState, error)

mock function

func (*MockNodeStore) GetNodeResourceRecentState

func (n *MockNodeStore) GetNodeResourceRecentState() (*nodestore.NodeResourceState, error)

mock function

func (*MockNodeStore) GetNodeStoreSupportedTags

func (n *MockNodeStore) GetNodeStoreSupportedTags() []string

mock function

type MockPerfStore

type MockPerfStore struct{}

MockPerfStore mock perf resource store

func (*MockPerfStore) GetPerfResourceRangeStats

func (p *MockPerfStore) GetPerfResourceRangeStats(key string, start, end time.Time,
	count int) ([]*perfstore.PerfMetrics, error)

mock function

func (*MockPerfStore) GetPerfResourceRecentState

func (p *MockPerfStore) GetPerfResourceRecentState(key string) (*perfstore.PerfMetrics, error)

mock function

func (*MockPerfStore) ListPerfResourceRangeStats

func (p *MockPerfStore) ListPerfResourceRangeStats(start, end time.Time,
	count int) (map[string][]*perfstore.PerfMetrics, error)

mock function

func (*MockPerfStore) ListPerfResourceRecentStats

func (p *MockPerfStore) ListPerfResourceRecentStats() ([]*perfstore.PerfMetrics, error)

mock function

type MockPromStore

type MockPromStore struct{}

MockPromStore mock prometheus resource store

func (*MockPromStore) GetPromDirectMetrics

func (prom *MockPromStore) GetPromDirectMetrics() (metricFamilies map[string]*dto.MetricFamily, err error)

mock function

func (*MockPromStore) GetPromRangeMetrics

func (prom *MockPromStore) GetPromRangeMetrics(key string, start, end time.Time, count int) ([]float64, error)

mock function

func (*MockPromStore) GetPromRecentMetrics

func (prom *MockPromStore) GetPromRecentMetrics(key string) (float64, error)

mock function

type MockRDTStore

type MockRDTStore struct{}

MockRDTStore mock rdt resource store

func (*MockRDTStore) GetRDTResourceRangeStats

func (r *MockRDTStore) GetRDTResourceRangeStats(key string, start, end time.Time,
	count int) ([]*rdtstore.RdtMetrics, error)

mock function

func (*MockRDTStore) GetRDTResourceRecentState

func (r *MockRDTStore) GetRDTResourceRecentState(key string) (*rdtstore.RdtMetrics, error)

mock function

func (*MockRDTStore) ListRDTResourceRangeStats

func (r *MockRDTStore) ListRDTResourceRangeStats(start, end time.Time,
	count int) (map[string][]*rdtstore.RdtMetrics, error)

mock function

func (*MockRDTStore) ListRDTResourceRecentStats

func (r *MockRDTStore) ListRDTResourceRecentStats() ([]*rdtstore.RdtMetrics, error)

mock function

type MockStatStore

type MockStatStore struct {
	*MockCommonStore
	*MockCgroupStore
}

MockStatStore describe fake resource stats type

func (*MockStatStore) Name

func (ss *MockStatStore) Name() string

mock function

func (*MockStatStore) Run

func (ss *MockStatStore) Run(stopCh <-chan struct{})

mock function

Jump to

Keyboard shortcuts

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