debug

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StageE2E        = "E2E"
	StageBeforeEach = "BeforeEach"
	StageAfterEach  = "AfterEach"
)
View Source
const (
	NoWatch  = "NoWatch"
	NoEvents = "NoEvents"
)

Variables

This section is empty.

Functions

func AfterEach

func AfterEach(ctx context.Context)

func BeforeEach

func BeforeEach(ctx context.Context, config *rest.Config, kubeClient client.Client)

func PrintTestTimes

func PrintTestTimes(times map[string][]TimeInterval) map[string][][]string

PrintTestTimes returns a list of tables. Each table has a list of Timestamps, where each timestamp is a list of strings.

func WriteTimestamps

func WriteTimestamps(outputDir string, timestamps *TimeIntervalCollector) error

WriteTimestamps will create a temp directory and a .csv file for each suite test If the OUTPUT_DIR environment variable is set, we'll print the csvs to that directory.

Types

type EventClient

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

func NewEventClient

func NewEventClient(kubeClient client.Client) *EventClient

func (*EventClient) DumpEvents

func (c *EventClient) DumpEvents(ctx context.Context) error

type Monitor

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

func New

func New(ctx context.Context, config *rest.Config, kubeClient client.Client) *Monitor

func (*Monitor) MustStart

func (m *Monitor) MustStart()

MustStart starts the debug monitor

func (*Monitor) Stop

func (m *Monitor) Stop()

Stop stops the monitor

type NodeClaimController

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

func NewNodeClaimController

func NewNodeClaimController(kubeClient client.Client) *NodeClaimController

func (*NodeClaimController) GetInfo

func (c *NodeClaimController) GetInfo(nc *v1.NodeClaim) string

func (*NodeClaimController) Reconcile

func (*NodeClaimController) Register

type NodeController

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

func NewNodeController

func NewNodeController(kubeClient client.Client) *NodeController

func (*NodeController) GetInfo

func (c *NodeController) GetInfo(ctx context.Context, n *corev1.Node) string

func (*NodeController) Reconcile

func (*NodeController) Register

func (c *NodeController) Register(ctx context.Context, m manager.Manager) error

type PodController

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

func NewPodController

func NewPodController(kubeClient client.Client) *PodController

func (*PodController) GetInfo

func (c *PodController) GetInfo(p *v1.Pod) string

func (*PodController) Reconcile

func (c *PodController) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)

func (*PodController) Register

func (c *PodController) Register(_ context.Context, m manager.Manager) error

type TimeInterval

type TimeInterval struct {
	Start time.Time
	End   time.Time
	Stage string
}

func (TimeInterval) String

func (t TimeInterval) String() []string

type TimeIntervalCollector

type TimeIntervalCollector struct {

	// used for ordering on Collect
	Stages []string
	// contains filtered or unexported fields
}

func NewTimestampCollector

func NewTimestampCollector() *TimeIntervalCollector

func (*TimeIntervalCollector) End

func (t *TimeIntervalCollector) End(stage string)

End will mark the interval's end time. If there is no End associated with a Start, the interval's inferred End is at the start of the AfterEach.

func (*TimeIntervalCollector) Finalize

func (t *TimeIntervalCollector) Finalize()

Finalize will automatically add End time entries for Start entries without a corresponding set End. This is useful for when the test fails, since deferring time recording is tough to do.

func (*TimeIntervalCollector) Record

func (t *TimeIntervalCollector) Record(name string)

Record adds the current starts/ends/stages as a list of time intervals, and adds it to the existingTimestamps, then resets the starts/ends/stages.

func (*TimeIntervalCollector) Reset

func (t *TimeIntervalCollector) Reset()

func (*TimeIntervalCollector) Start

func (t *TimeIntervalCollector) Start(stage string) time.Time

Start will add a timestamp with the given stage and add it to the list If there is no End associated with a Start, the interval's inferred End is at the start of the AfterEach.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL