tests

package
v0.0.0-...-188825c Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package tests holds tests related files

Package tests holds tests related files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeMonoTagger

func NewFakeMonoTagger() tags.Tagger

NewFakeMonoTagger returns a new tags tagger

func NewFakeTaggerDifferentImageNames

func NewFakeTaggerDifferentImageNames() tags.Tagger

NewFakeTaggerDifferentImageNames returns a new tagger

Types

type FakeManualTagger

type FakeManualTagger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FakeManualTagger represents a fake manual tagger

func NewFakeManualTagger

func NewFakeManualTagger() *FakeManualTagger

NewFakeManualTagger returns a new tagger

func (*FakeManualTagger) GetContainerSelector

func (fmr *FakeManualTagger) GetContainerSelector(containerID string) *cgroupModel.WorkloadSelector

GetContainerSelector returns the container selector

func (*FakeManualTagger) GlobalTags

func (fmr *FakeManualTagger) GlobalTags(_ types.TagCardinality) ([]string, error)

GlobalTags returns the global tags

func (*FakeManualTagger) SpecifyNextSelector

func (fmr *FakeManualTagger) SpecifyNextSelector(selector *cgroupModel.WorkloadSelector)

SpecifyNextSelector specifies the next image name and tag to be resolved

func (*FakeManualTagger) Tag

func (fmr *FakeManualTagger) Tag(entity types.EntityID, _ types.TagCardinality) ([]string, error)

Tag returns the tags for the given id

type FakeMonoTagger

type FakeMonoTagger struct{}

FakeMonoTagger represents a fake mono tagger

func (*FakeMonoTagger) GlobalTags

func (fmr *FakeMonoTagger) GlobalTags(_ types.TagCardinality) ([]string, error)

GlobalTags returns the global tags

func (*FakeMonoTagger) Tag

func (fmr *FakeMonoTagger) Tag(entity types.EntityID, _ types.TagCardinality) ([]string, error)

Tag returns the tags for the given id

type FakeTagger

type FakeTagger struct {
	sync.Mutex
	// contains filtered or unexported fields
}

FakeTagger represents a fake tagger

func (*FakeTagger) GlobalTags

func (fr *FakeTagger) GlobalTags(_ types.TagCardinality) ([]string, error)

GlobalTags returns the global tags

func (*FakeTagger) Tag

func (fr *FakeTagger) Tag(entity types.EntityID, _ types.TagCardinality) ([]string, error)

Tag returns the tags for the given id

type TraceEvent

type TraceEvent struct {
	Raw       string
	Task      string
	PID       string
	CPU       string
	Flags     string
	Timestamp string
	Function  string
	Message   string
}

TraceEvent contains the raw event as well as the contents of every field as string, as defined under "Output format" in https://www.kernel.org/doc/Documentation/trace/ftrace.txt

type TracePipe

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

TracePipe to read from /sys/kernel/[debug/]tracing/trace_pipe Note that data can be read only once, i.e. if you have more than one tracer / channel, only one will receive an event: "Once data is read from this file, it is consumed, and will not be read again with a sequential read." https://www.kernel.org/doc/Documentation/trace/ftrace.txt

func NewTracePipe

func NewTracePipe() (*TracePipe, error)

NewTracePipe instantiates a new trace pipe

func (*TracePipe) Channel

func (t *TracePipe) Channel() (<-chan *TraceEvent, <-chan error)

Channel returns a channel of events and an other for errors

func (*TracePipe) Close

func (t *TracePipe) Close() error

Close the trace pipe

func (*TracePipe) ReadLine

func (t *TracePipe) ReadLine() (*TraceEvent, error)

ReadLine reads a line

Directories

Path Synopsis
Package statsdclient holds statsdclient related files
Package statsdclient holds statsdclient related files
Package testutils holds test utility functions
Package testutils holds test utility functions

Jump to

Keyboard shortcuts

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