Documentation ¶
Overview ¶
Package stats handles exporting Kubelet and container stats. NOTE: We intend to move this functionality into a standalone pod, so this package should be very loosely coupled to the rest of the Kubelet.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHandlers ¶ added in v0.4.0
func CreateHandlers(provider StatsProvider, summaryProvider SummaryProvider) *restful.WebService
Types ¶
type Cache ¶ added in v0.4.0
Map to PodVolumeStats pointers since the addresses for map values are not constant and can cause pain if we need ever to get a pointer to one of the values (e.g. you can't)
type PodVolumeStats ¶ added in v0.4.0
type PodVolumeStats struct {
Volumes []stats.VolumeStats
}
PodVolumeStats encapsulates all VolumeStats for a pod
type ResourceAnalyzer ¶ added in v0.4.0
type ResourceAnalyzer interface { Start() SummaryProvider // contains filtered or unexported methods }
ResourceAnalyzer provides statistics on node resource consumption
func NewResourceAnalyzer ¶ added in v0.4.0
func NewResourceAnalyzer(statsProvider StatsProvider, calVolumeFrequency time.Duration, runtime container.Runtime) ResourceAnalyzer
NewResourceAnalyzer returns a new ResourceAnalyzer
type StatsProvider ¶ added in v0.4.0
type StatsProvider interface { GetContainerInfo(podFullName string, uid types.UID, containerName string, req *cadvisorapi.ContainerInfoRequest) (*cadvisorapi.ContainerInfo, error) GetContainerInfoV2(name string, options cadvisorapiv2.RequestOptions) (map[string]cadvisorapiv2.ContainerInfo, error) GetRawContainerInfo(containerName string, req *cadvisorapi.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapi.ContainerInfo, error) GetPodByName(namespace, name string) (*api.Pod, bool) GetNode() (*api.Node, error) GetNodeConfig() cm.NodeConfig ImagesFsInfo() (cadvisorapiv2.FsInfo, error) RootFsInfo() (cadvisorapiv2.FsInfo, error) ListVolumesForPod(podUID types.UID) (map[string]volume.Volume, bool) GetPods() []*api.Pod }
Host methods required by stats handlers.
type StatsRequest ¶ added in v0.4.0
type StatsRequest struct { // The name of the container for which to request stats. // Default: / ContainerName string `json:"containerName,omitempty"` // Max number of stats to return. // If start and end time are specified this limit is ignored. // Default: 60 NumStats int `json:"num_stats,omitempty"` // Start time for which to query information. // If omitted, the beginning of time is assumed. Start time.Time `json:"start,omitempty"` // End time for which to query information. // If omitted, current time is assumed. End time.Time `json:"end,omitempty"` // Whether to also include information from subcontainers. // Default: false. Subcontainers bool `json:"subcontainers,omitempty"` }
type SummaryProvider ¶ added in v0.4.0
type SummaryProvider interface { // Get provides a new Summary using the latest results from cadvisor Get() (*stats.Summary, error) }
func NewSummaryProvider ¶ added in v0.4.0
func NewSummaryProvider(statsProvider StatsProvider, fsResourceAnalyzer fsResourceAnalyzerInterface, cruntime container.Runtime) SummaryProvider
NewSummaryProvider returns a new SummaryProvider
Click to show internal directories.
Click to hide internal directories.