Documentation ¶
Overview ¶
Package biz provides business-value metrics from system raw metrics
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrExitedContainerExpired = errors.New("container exited TTL expired")
var ErrExitedContainerUnexpired = errors.New("exited containers have no metrics to fetch")
Functions ¶
This section is empty.
Types ¶
type BlkIO ¶
type BlkIO struct { TotalReadCount float64 TotalWriteCount float64 TotalReadBytes float64 TotalWriteBytes float64 }
BlkIO stands for Block I/O stats
type CPU ¶
type CPU struct { CPUPercent float64 KernelPercent float64 UserPercent float64 UsedCores float64 LimitCores float64 UsedCoresPercent float64 ThrottlePeriods uint64 ThrottledTimeMS float64 }
CPU metrics
type DeviceMapperStats ¶ added in v1.6.0
type DeviceMapperStats struct { DataAvailable uint64 DataUsed uint64 DataTotal uint64 DataUsagePercent float64 MetadataAvailable uint64 MetadataUsed uint64 MetadataTotal uint64 MetadataUsagePercent float64 }
DeviceMapperStats contains the stats of devicemapper storages driver type
func ParseDeviceMapperStats ¶ added in v1.6.0
func ParseDeviceMapperStats(info types.Info) (*DeviceMapperStats, error)
ParseDeviceMapperStats parses the output from the info DriverStatus info Array. This information is not consider stable by Docker and could change anytime according to API the docs.
type Memory ¶
type Memory struct { UsageBytes uint64 CacheUsageBytes uint64 RSSUsageBytes uint64 MemLimitBytes uint64 UsagePercent float64 // Usage percent from the limit, if any KernelUsageBytes uint64 SwapUsageBytes uint64 SwapOnlyUsageBytes uint64 SwapLimitBytes uint64 SwapLimitUsagePercent float64 SoftLimitBytes uint64 }
Memory metrics
type MetricsFetcher ¶
type MetricsFetcher struct {
// contains filtered or unexported fields
}
MetricsFetcher fetches the container system-level metrics from different sources and processes it to export metrics with business-value
func NewProcessor ¶
func NewProcessor(store persist.Storer, fetcher raw.Fetcher, inspector raw.DockerInspector, exitedContainerTTL time.Duration) *MetricsFetcher
NewProcessor creates a MetricsFetcher from implementations of its required components
func (*MetricsFetcher) Process ¶
func (mc *MetricsFetcher) Process(containerID string) (Sample, error)
Process returns a metrics Sample of the container with the given ID
func (*MetricsFetcher) WithRuntimeNumCPUfunc ¶ added in v1.9.0
func (mc *MetricsFetcher) WithRuntimeNumCPUfunc(rcFunc func() int)
WithRuntimeNumCPUfunc changes the NumCPU counting func so MetricsFetcher is mockable