sensor

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main()

Main is the main entrypoint for the sensor

Types

type ContainerEventRepeater

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

func NewContainerEventRepeater

func NewContainerEventRepeater(sensor *Sensor) (*ContainerEventRepeater, error)

func (*ContainerEventRepeater) NewEventStream

func (cer *ContainerEventRepeater) NewEventStream(sub *api.Subscription) (*stream.Stream, error)

type MetricsCounters

type MetricsCounters struct {
	// Number of events created during the sample period
	Events uint64

	// Number of subscriptions
	Subscriptions int32
}

Counters used for metrics

type ProcessInfoCache

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

func NewProcessInfoCache

func NewProcessInfoCache(sensor *Sensor) ProcessInfoCache

func (*ProcessInfoCache) ProcessContainerId

func (pc *ProcessInfoCache) ProcessContainerId(pid int) (string, bool)

processContainerId returns the container ID that the process indicated by the given host PID.

func (*ProcessInfoCache) ProcessId

func (pc *ProcessInfoCache) ProcessId(pid int) (string, bool)

ProcessId returns the unique ID for the thread group of the process indicated by the given PID. This process ID is identical whether it is derived inside or outside a container.

type Sensor

type Sensor struct {
	// Unique Id for this sensor. Sensor Ids are ephemeral.
	Id string

	// Metrics counters for this sensor
	Metrics MetricsCounters
	// contains filtered or unexported fields
}

Sensor represents the state of the singleton Sensor instance

func NewSensor

func NewSensor() (*Sensor, error)

func (*Sensor) NewEvent

func (s *Sensor) NewEvent() *api.Event

func (*Sensor) NewEventFromContainer

func (s *Sensor) NewEventFromContainer(containerId string) *api.Event

func (*Sensor) NewEventFromSample

func (s *Sensor) NewEventFromSample(sample *perf.SampleRecord,
	data perf.TraceEventSampleData) *api.Event

func (*Sensor) NewSubscription

func (s *Sensor) NewSubscription(sub *api.Subscription) (*stream.Stream, error)

NewSubscription creates a new telemetry subscription from the given api.Subscription descriptor. NewSubscription returns a stream.Stream of api.Events matching the specified filters. Closing the Stream cancels the subscription.

func (*Sensor) Start

func (s *Sensor) Start() error

func (*Sensor) Stop

func (s *Sensor) Stop()

type TelemetryService

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

func NewTelemetryService

func NewTelemetryService(sensor *Sensor, address string) *TelemetryService

func (*TelemetryService) Name

func (ts *TelemetryService) Name() string

func (*TelemetryService) Serve

func (ts *TelemetryService) Serve() error

func (*TelemetryService) Stop

func (ts *TelemetryService) Stop()

Jump to

Keyboard shortcuts

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