...

Package debug

import "k8s.io/kubernetes/test/e2e/framework/debug"
Overview
Index
Subdirectories

Overview ▾

Index ▾

func DumpAllNamespaceInfo(ctx context.Context, c clientset.Interface, namespace string)
func DumpNodeDebugInfo(ctx context.Context, c clientset.Interface, nodeNames []string, logFunc func(fmt string, args ...interface{}))
type ContainerResourceGatherer
    func NewResourceUsageGatherer(ctx context.Context, c clientset.Interface, options ResourceGathererOptions, pods *v1.PodList) (*ContainerResourceGatherer, error)
    func (g *ContainerResourceGatherer) StartGatheringData(ctx context.Context)
    func (g *ContainerResourceGatherer) StopAndSummarize(percentiles []int, constraints map[string]ResourceConstraint) (*ResourceUsageSummary, error)
type ContainerResourceUsage
type EventsLister
type LogSizeDataTimeseries
type LogSizeGatherer
    func (g *LogSizeGatherer) Run(ctx context.Context)
    func (g *LogSizeGatherer) Work(ctx context.Context) bool
type LogsSizeData
type LogsSizeDataSummary
    func (s *LogsSizeDataSummary) PrintHumanReadable() string
    func (s *LogsSizeDataSummary) PrintJSON() string
    func (s *LogsSizeDataSummary) SummaryKind() string
type LogsSizeVerifier
    func NewLogsVerifier(ctx context.Context, c clientset.Interface) *LogsSizeVerifier
    func (s *LogsSizeVerifier) GetSummary() *LogsSizeDataSummary
    func (s *LogsSizeVerifier) Run(ctx context.Context)
type NodesSet
type ResourceConstraint
type ResourceGathererOptions
type ResourceUsagePerContainer
type ResourceUsageSummary
    func (s *ResourceUsageSummary) PrintHumanReadable() string
    func (s *ResourceUsageSummary) PrintJSON() string
    func (s *ResourceUsageSummary) SummaryKind() string
type SingleContainerSummary
type SingleLogSummary
type TimestampedSize
type WorkItem

Package files

dump.go log_size_monitoring.go resource_usage_gatherer.go

func DumpAllNamespaceInfo

func DumpAllNamespaceInfo(ctx context.Context, c clientset.Interface, namespace string)

DumpAllNamespaceInfo dumps events, pods and nodes information in the given namespace.

func DumpNodeDebugInfo

func DumpNodeDebugInfo(ctx context.Context, c clientset.Interface, nodeNames []string, logFunc func(fmt string, args ...interface{}))

DumpNodeDebugInfo dumps debug information of the given nodes.

type ContainerResourceGatherer

ContainerResourceGatherer is a struct for gathering container resource.

type ContainerResourceGatherer struct {
    // contains filtered or unexported fields
}

func NewResourceUsageGatherer

func NewResourceUsageGatherer(ctx context.Context, c clientset.Interface, options ResourceGathererOptions, pods *v1.PodList) (*ContainerResourceGatherer, error)

NewResourceUsageGatherer returns a new ContainerResourceGatherer.

func (*ContainerResourceGatherer) StartGatheringData

func (g *ContainerResourceGatherer) StartGatheringData(ctx context.Context)

StartGatheringData starts a stat gathering worker blocks for each node to track, and blocks until StopAndSummarize is called.

func (*ContainerResourceGatherer) StopAndSummarize

func (g *ContainerResourceGatherer) StopAndSummarize(percentiles []int, constraints map[string]ResourceConstraint) (*ResourceUsageSummary, error)

StopAndSummarize stops stat gathering workers, processes the collected stats, generates resource summary for the passed-in percentiles, and returns the summary. It returns an error if the resource usage at any percentile is beyond the specified resource constraints.

type ContainerResourceUsage

ContainerResourceUsage is a structure for gathering container resource usage.

type ContainerResourceUsage struct {
    Name                    string
    Timestamp               time.Time
    CPUUsageInCores         float64
    MemoryUsageInBytes      uint64
    MemoryWorkingSetInBytes uint64
    MemoryRSSInBytes        uint64
    // The interval used to calculate CPUUsageInCores.
    CPUInterval time.Duration
}

type EventsLister

EventsLister is a func that lists events.

type EventsLister func(opts metav1.ListOptions, ns string) (*v1.EventList, error)

type LogSizeDataTimeseries

LogSizeDataTimeseries is map of timestamped size.

type LogSizeDataTimeseries map[string]map[string][]TimestampedSize

type LogSizeGatherer

LogSizeGatherer is a worker which grabs a WorkItem from the channel and does assigned work.

type LogSizeGatherer struct {
    // contains filtered or unexported fields
}

func (*LogSizeGatherer) Run

func (g *LogSizeGatherer) Run(ctx context.Context)

Run starts log size gathering.

func (*LogSizeGatherer) Work

func (g *LogSizeGatherer) Work(ctx context.Context) bool

Work does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine, gathers data, writes it to the shared <data> map, and creates a gorouting which reinserts work item into the queue with a <pollingPeriod> delay. Returns false if worker should exit.

type LogsSizeData

LogsSizeData is a structure for handling timeseries of log size data and lock.

type LogsSizeData struct {
    // contains filtered or unexported fields
}

type LogsSizeDataSummary

LogsSizeDataSummary is map of log summary. node -> file -> data

type LogsSizeDataSummary map[string]map[string]SingleLogSummary

func (*LogsSizeDataSummary) PrintHumanReadable

func (s *LogsSizeDataSummary) PrintHumanReadable() string

PrintHumanReadable returns string of log size data summary. TODO: make sure that we don't need locking here

func (*LogsSizeDataSummary) PrintJSON

func (s *LogsSizeDataSummary) PrintJSON() string

PrintJSON returns the summary of log size data with JSON format.

func (*LogsSizeDataSummary) SummaryKind

func (s *LogsSizeDataSummary) SummaryKind() string

SummaryKind returns the summary of log size data summary.

type LogsSizeVerifier

LogsSizeVerifier gathers data about log files sizes from master and node machines. It oversees a <workersNo> workers which do the gathering.

type LogsSizeVerifier struct {
    // contains filtered or unexported fields
}

func NewLogsVerifier

func NewLogsVerifier(ctx context.Context, c clientset.Interface) *LogsSizeVerifier

NewLogsVerifier creates a new LogsSizeVerifier which will stop when stopChannel is closed

func (*LogsSizeVerifier) GetSummary

func (s *LogsSizeVerifier) GetSummary() *LogsSizeDataSummary

GetSummary returns a summary (average generation rate and number of probes) of the data gathered by LogSizeVerifier

func (*LogsSizeVerifier) Run

func (s *LogsSizeVerifier) Run(ctx context.Context)

Run starts log size gathering. It starts a gorouting for every worker and then blocks until stopChannel is closed

type NodesSet

NodesSet is a value of nodes set.

type NodesSet int
const (
    // AllNodes means all containers on all nodes.
    AllNodes NodesSet = 0
    // MasterNodes means all containers on Master nodes only.
    MasterNodes NodesSet = 1
    // MasterAndDNSNodes means all containers on Master nodes and DNS containers on other nodes.
    MasterAndDNSNodes NodesSet = 2
)

type ResourceConstraint

ResourceConstraint is a struct to hold constraints.

type ResourceConstraint struct {
    CPUConstraint    float64
    MemoryConstraint uint64
}

type ResourceGathererOptions

ResourceGathererOptions is a struct to hold options for resource.

type ResourceGathererOptions struct {
    InKubemark                  bool
    Nodes                       NodesSet
    ResourceDataGatheringPeriod time.Duration
    ProbeDuration               time.Duration
    PrintVerboseLogs            bool
}

type ResourceUsagePerContainer

ResourceUsagePerContainer is map of ContainerResourceUsage

type ResourceUsagePerContainer map[string]*ContainerResourceUsage

type ResourceUsageSummary

ResourceUsageSummary is a struct to hold resource usage summary. we can't have int here, as JSON does not accept integer keys.

type ResourceUsageSummary map[string][]SingleContainerSummary

func (*ResourceUsageSummary) PrintHumanReadable

func (s *ResourceUsageSummary) PrintHumanReadable() string

PrintHumanReadable prints resource usage summary in human readable.

func (*ResourceUsageSummary) PrintJSON

func (s *ResourceUsageSummary) PrintJSON() string

PrintJSON prints resource usage summary in JSON.

func (*ResourceUsageSummary) SummaryKind

func (s *ResourceUsageSummary) SummaryKind() string

SummaryKind returns string of ResourceUsageSummary

type SingleContainerSummary

SingleContainerSummary is a struct to hold single container summary.

type SingleContainerSummary struct {
    Name string
    CPU  float64
    Mem  uint64
}

type SingleLogSummary

SingleLogSummary is a structure for handling average generation rate and number of probes.

type SingleLogSummary struct {
    AverageGenerationRate int
    NumberOfProbes        int
}

type TimestampedSize

TimestampedSize contains a size together with a time of measurement.

type TimestampedSize struct {
    // contains filtered or unexported fields
}

type WorkItem

WorkItem is a command for a worker that contains an IP of machine from which we want to gather data and paths to all files we're interested in.

type WorkItem struct {
    // contains filtered or unexported fields
}

Subdirectories

Name Synopsis
..
init Package init sets debug.DumpAllNamespaceInfo as implementation in the framework and enables log size verification and resource gathering.