Documentation ¶
Index ¶
- func NewMockStatStore(common *MockCommonStore, cgroup *MockCgroupStore) statestore.StateStore
- type MockCgroupStore
- func (cg *MockCgroupStore) AddExtraCgroups(extraCgs []string) error
- func (cg *MockCgroupStore) GetCgroupResourceRangeStats(podName, podNamespace string, start, end time.Time, count int) ([]*cgroupstore.CgroupStats, error)
- func (cg *MockCgroupStore) GetCgroupResourceRecentState(podName, podNamespace string, updateStats bool) (*cgroupstore.CgroupStats, error)
- func (cg *MockCgroupStore) GetCgroupResourceRecentStateByPath(cgPath string, updateStats bool) (*cgroupstore.CgroupStats, error)
- func (cg *MockCgroupStore) GetCgroupStoreSupportedTags() []string
- func (cg *MockCgroupStore) ListAllCgroups(classFilter sets.String) (map[string]*cgroupstore.CgroupRef, error)
- func (cg *MockCgroupStore) ListCgroupResourceRangeStats(start, end time.Time, count int, classFilter sets.String) (map[string][]*cgroupstore.CgroupStats, error)
- func (cg *MockCgroupStore) ListCgroupResourceRecentState(updateStats bool, classFilter sets.String) (map[string]*cgroupstore.CgroupStats, error)
- func (cg *MockCgroupStore) MachineInfo() (*cadvisorapi.MachineInfo, error)
- type MockCommonStore
- type MockCustomizeStore
- type MockNodeStore
- type MockPerfStore
- func (p *MockPerfStore) GetPerfResourceRangeStats(key string, start, end time.Time, count int) ([]*perfstore.PerfMetrics, error)
- func (p *MockPerfStore) GetPerfResourceRecentState(key string) (*perfstore.PerfMetrics, error)
- func (p *MockPerfStore) ListPerfResourceRangeStats(start, end time.Time, count int) (map[string][]*perfstore.PerfMetrics, error)
- func (p *MockPerfStore) ListPerfResourceRecentStats() ([]*perfstore.PerfMetrics, error)
- type MockPromStore
- type MockRDTStore
- func (r *MockRDTStore) GetRDTResourceRangeStats(key string, start, end time.Time, count int) ([]*rdtstore.RdtMetrics, error)
- func (r *MockRDTStore) GetRDTResourceRecentState(key string) (*rdtstore.RdtMetrics, error)
- func (r *MockRDTStore) ListRDTResourceRangeStats(start, end time.Time, count int) (map[string][]*rdtstore.RdtMetrics, error)
- func (r *MockRDTStore) ListRDTResourceRecentStats() ([]*rdtstore.RdtMetrics, error)
- type MockStatStore
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 ¶
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 ¶
type MockCommonStore struct { *MockNodeStore *MockPerfStore *MockRDTStore *MockCustomizeStore *MockPromStore }
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