Documentation ¶
Index ¶
- Variables
- type Collector
- type CollectorMetadata
- type ContainerCPUStats
- type ContainerIOStats
- type ContainerMemStats
- type ContainerNetworkStats
- type ContainerPIDStats
- type ContainerStats
- type DeviceIOStats
- type InterfaceNetStats
- type MockCollector
- func (mp *MockCollector) Clear()
- func (mp *MockCollector) DeleteContainerEntry(containerID string)
- func (mp *MockCollector) GetContainerNetworkStats(containerID string, cacheValidity time.Duration, networks map[string]string) (*ContainerNetworkStats, error)
- func (mp *MockCollector) GetContainerStats(containerID string, cacheValidity time.Duration) (*ContainerStats, error)
- func (mp *MockCollector) ID() string
- func (mp *MockCollector) SetContainerEntry(containerID string, cEntry MockContainerEntry)
- type MockContainerEntry
- type MockMetricsProvider
- func (mp *MockMetricsProvider) Clear()
- func (mp *MockMetricsProvider) GetCollector(runtime string) Collector
- func (mp *MockMetricsProvider) RegisterCollector(collectorMeta CollectorMetadata)
- func (mp *MockMetricsProvider) RegisterConcreteCollector(runtime string, c Collector)
- func (mp *MockMetricsProvider) RemoveCollector(runtime string)
- type Provider
Constants ¶
This section is empty.
Variables ¶
var GetProvider = provider.GetProvider
GetProvider returns the metrics provider singleton
Functions ¶
This section is empty.
Types ¶
type CollectorMetadata ¶
type CollectorMetadata = provider.CollectorMetadata
CollectorMetadata contains the characteristics of a collector to be registered with RegisterCollector
type ContainerCPUStats ¶
type ContainerCPUStats = provider.ContainerCPUStats
ContainerCPUStats stores CPU stats.
type ContainerIOStats ¶
type ContainerIOStats = provider.ContainerIOStats
ContainerIOStats store I/O statistics about a container.
type ContainerMemStats ¶
type ContainerMemStats = provider.ContainerMemStats
ContainerMemStats stores memory statistics.
type ContainerNetworkStats ¶
type ContainerNetworkStats = provider.ContainerNetworkStats
ContainerNetworkStats stores network statistics about a container per interface
type ContainerPIDStats ¶
type ContainerPIDStats = provider.ContainerPIDStats
ContainerPIDStats stores stats about threads & processes.
type ContainerStats ¶
type ContainerStats = provider.ContainerStats
ContainerStats wraps all container metrics
type DeviceIOStats ¶
type DeviceIOStats = provider.DeviceIOStats
DeviceIOStats stores Device IO stats.
type InterfaceNetStats ¶
type InterfaceNetStats = provider.InterfaceNetStats
InterfaceNetStats stores network statistics about a network interface
type MockCollector ¶
type MockCollector struct {
// contains filtered or unexported fields
}
MockCollector is a mocked collector
func NewMockCollector ¶
func NewMockCollector(id string) *MockCollector
NewMockCollector creates a MockCollector
func (*MockCollector) DeleteContainerEntry ¶
func (mp *MockCollector) DeleteContainerEntry(containerID string)
DeleteContainerEntry removes the entry for containerID
func (*MockCollector) GetContainerNetworkStats ¶
func (mp *MockCollector) GetContainerNetworkStats(containerID string, cacheValidity time.Duration, networks map[string]string) (*ContainerNetworkStats, error)
GetContainerNetworkStats returns stats from MockContainerEntry
func (*MockCollector) GetContainerStats ¶
func (mp *MockCollector) GetContainerStats(containerID string, cacheValidity time.Duration) (*ContainerStats, error)
GetContainerStats returns stats from MockContainerEntry
func (*MockCollector) SetContainerEntry ¶
func (mp *MockCollector) SetContainerEntry(containerID string, cEntry MockContainerEntry)
SetContainerEntry sets an entry for a given containerID
type MockContainerEntry ¶
type MockContainerEntry struct { ContainerStats ContainerStats NetworkStats ContainerNetworkStats Error error }
MockContainerEntry allows to customize mock responses
type MockMetricsProvider ¶
type MockMetricsProvider struct {
// contains filtered or unexported fields
}
MockMetricsProvider can be used to create tests
func NewMockMetricsProvider ¶
func NewMockMetricsProvider() *MockMetricsProvider
NewMockMetricsProvider creates a mock provider
func (*MockMetricsProvider) Clear ¶
func (mp *MockMetricsProvider) Clear()
Clear removes all collectors
func (*MockMetricsProvider) GetCollector ¶
func (mp *MockMetricsProvider) GetCollector(runtime string) Collector
GetCollector emulates the MetricsProvider interface
func (*MockMetricsProvider) RegisterCollector ¶
func (mp *MockMetricsProvider) RegisterCollector(collectorMeta CollectorMetadata)
RegisterCollector registers a collector
func (*MockMetricsProvider) RegisterConcreteCollector ¶
func (mp *MockMetricsProvider) RegisterConcreteCollector(runtime string, c Collector)
RegisterConcreteCollector registers a collector
func (*MockMetricsProvider) RemoveCollector ¶
func (mp *MockMetricsProvider) RemoveCollector(runtime string)
RemoveCollector removes a collector