devops

package
v0.0.0-...-e01a1e4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MachineTeamChoices = []string{
		"SF",
		"NYC",
		"LON",
		"CHI",
	}
	MachineOSChoices = []string{
		"Ubuntu16.10",
		"Ubuntu16.04LTS",
		"Ubuntu15.10",
	}
	MachineArchChoices = []string{
		"x64",
		"x86",
	}
	MachineServiceEnvironmentChoices = []string{
		"production",
		"staging",
		"test",
	}

	// MachineTagKeys fields common to all hosts:
	MachineTagKeys = [][]byte{
		[]byte("hostname"),
		[]byte("region"),
		[]byte("datacenter"),
		[]byte("rack"),
		[]byte("os"),
		[]byte("arch"),
		[]byte("team"),
		[]byte("service"),
		[]byte("service_version"),
		[]byte("service_environment"),
	}
)

Functions

This section is empty.

Types

type CPUMeasurement

type CPUMeasurement struct {
	*common.SubsystemMeasurement
}

func NewCPUMeasurement

func NewCPUMeasurement(start time.Time) *CPUMeasurement

func (*CPUMeasurement) ToPoint

func (m *CPUMeasurement) ToPoint(p *data.Point)

type CPUOnlySimulator

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

A CPUOnlySimulator generates data similar to telemetry from Telegraf for only CPU metrics. It fulfills the Simulator interface.

func (*CPUOnlySimulator) Fields

func (d *CPUOnlySimulator) Fields() map[string][]string

Fields returns a map of subsystems to metrics collected

func (CPUOnlySimulator) Finished

func (s CPUOnlySimulator) Finished() bool

Finished tells whether we have simulated all the necessary points

func (*CPUOnlySimulator) Headers

func (*CPUOnlySimulator) Next

func (d *CPUOnlySimulator) Next(p *data.Point) bool

Next advances a Point to the next state in the generator.

func (CPUOnlySimulator) TagKeys

func (s CPUOnlySimulator) TagKeys() []string

func (CPUOnlySimulator) TagTypes

func (s CPUOnlySimulator) TagTypes() []string

type CPUOnlySimulatorConfig

type CPUOnlySimulatorConfig commonDevopsSimulatorConfig

CPUOnlySimulatorConfig is used to create a CPUOnlySimulator.

func (*CPUOnlySimulatorConfig) NewSimulator

func (c *CPUOnlySimulatorConfig) NewSimulator(interval time.Duration, limit uint64) common.Simulator

NewSimulator produces a Simulator that conforms to the given SimulatorConfig over the specified interval

type DevopsSimulator

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

DevopsSimulator generates data similar to telemetry, with metrics from a variety of device systems. It fulfills the Simulator interface.

func (DevopsSimulator) Fields

func (s DevopsSimulator) Fields() map[string][]string

func (DevopsSimulator) Finished

func (s DevopsSimulator) Finished() bool

Finished tells whether we have simulated all the necessary points

func (*DevopsSimulator) Headers

func (*DevopsSimulator) Next

func (d *DevopsSimulator) Next(p *data.Point) bool

Next advances a Point to the next state in the generator.

func (*DevopsSimulator) TagKeys

func (s *DevopsSimulator) TagKeys() []string

func (*DevopsSimulator) TagTypes

func (s *DevopsSimulator) TagTypes() []string

type DevopsSimulatorConfig

type DevopsSimulatorConfig commonDevopsSimulatorConfig

DevopsSimulatorConfig is used to create a DevopsSimulator.

func (*DevopsSimulatorConfig) NewSimulator

func (d *DevopsSimulatorConfig) NewSimulator(interval time.Duration, limit uint64) common.Simulator

NewSimulator produces a Simulator that conforms to the given SimulatorConfig over the specified interval

type DiskIOMeasurement

type DiskIOMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewDiskIOMeasurement

func NewDiskIOMeasurement(start time.Time) *DiskIOMeasurement

func (*DiskIOMeasurement) ToPoint

func (m *DiskIOMeasurement) ToPoint(p *data.Point)

type DiskMeasurement

type DiskMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewDiskMeasurement

func NewDiskMeasurement(start time.Time) *DiskMeasurement

NewDiskMeasurement returns a new populated DiskMeasurement

func (*DiskMeasurement) ToPoint

func (m *DiskMeasurement) ToPoint(p *data.Point)

ToPoint transfers (populates) the fields and tags of the supplied point

type GenericMeasurements

type GenericMeasurements struct {
	*common.SubsystemMeasurement
}

GenericMeasurements represents measurements generated for generic metric fields

func NewGenericMeasurements

func NewGenericMeasurements(start time.Time, count uint64) *GenericMeasurements

func (*GenericMeasurements) ToPoint

func (gm *GenericMeasurements) ToPoint(p *data.Point)

type GenericMetricsSimulator

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

GenericMetricsSimulator provides a possibility to generate a configurable amount of metrics per host where other simulators have hardcoded metric set. This simulator also controls how long a host lives (hosts lifetime follows zipf distribution)

func (*GenericMetricsSimulator) Fields

func (gms *GenericMetricsSimulator) Fields() map[string][]string

Fields returns a map of subsystems to metrics collected Since each host has different number of fields (we use zipf distribution to assign # fields) we search for the host with the max number of fields

func (GenericMetricsSimulator) Finished

func (s GenericMetricsSimulator) Finished() bool

Finished tells whether we have simulated all the necessary points

func (*GenericMetricsSimulator) Headers

func (*GenericMetricsSimulator) Next

func (gms *GenericMetricsSimulator) Next(p *data.Point) bool

Next advances a Point to the next state in the generator.

func (GenericMetricsSimulator) TagKeys

func (s GenericMetricsSimulator) TagKeys() []string

func (GenericMetricsSimulator) TagTypes

func (s GenericMetricsSimulator) TagTypes() []string

type GenericMetricsSimulatorConfig

type GenericMetricsSimulatorConfig struct {
	*DevopsSimulatorConfig
}

func (*GenericMetricsSimulatorConfig) NewSimulator

func (c *GenericMetricsSimulatorConfig) NewSimulator(interval time.Duration, limit uint64) common.Simulator

NewSimulator creates GenericMetricsSimulator for generic-devops use-case. Number of metrics assigned to each host follow zipf distribution. 50% of hosts is long lived and 50% has a liftspan that follows zipf distribution.

type Host

type Host struct {
	SimulatedMeasurements []common.SimulatedMeasurement

	// These are all assigned once, at Host creation:
	Name               string
	Region             string
	Datacenter         string
	Rack               string
	OS                 string
	Arch               string
	Team               string
	Service            string
	ServiceVersion     string
	ServiceEnvironment string

	// needed for generic use-casea
	GenericMetricCount uint64 // number of metrics generated
	StartEpoch         uint64
	EpochsToLive       uint64 // 0 means forever
}

Host models a machine being monitored for dev ops

func NewHost

func NewHost(ctx *HostContext) Host

NewHost creates a new host in a simulated devops use case

func NewHostCPUOnly

func NewHostCPUOnly(ctx *HostContext) Host

NewHostCPUOnly creates a new host in a simulated cpu-only use case, which is a subset of a devops case with only CPU metrics simulated

func NewHostCPUSingle

func NewHostCPUSingle(ctx *HostContext) Host

NewHostCPUSingle creates a new host in a simulated cpu-single use case, which is a subset of a devops case with only a single CPU metric is simulated

func NewHostGenericMetrics

func NewHostGenericMetrics(ctx *HostContext) Host

NewHostGenericMetrics creates a new host in simulated generic metrics use case. Useful for testing with high cardinality metrics

func (*Host) TickAll

func (h *Host) TickAll(d time.Duration)

TickAll advances all Distributions of a Host.

type HostContext

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

HostContext contains information needed to create a new host

func NewHostCtx

func NewHostCtx(id int, start time.Time) *HostContext

func NewHostCtxTime

func NewHostCtxTime(start time.Time) *HostContext

type KernelMeasurement

type KernelMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewKernelMeasurement

func NewKernelMeasurement(start time.Time) *KernelMeasurement

func (*KernelMeasurement) ToPoint

func (m *KernelMeasurement) ToPoint(p *data.Point)

type MemMeasurement

type MemMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewMemMeasurement

func NewMemMeasurement(start time.Time) *MemMeasurement

func (*MemMeasurement) ToPoint

func (m *MemMeasurement) ToPoint(p *data.Point)

type NetMeasurement

type NetMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewNetMeasurement

func NewNetMeasurement(start time.Time) *NetMeasurement

func (*NetMeasurement) ToPoint

func (m *NetMeasurement) ToPoint(p *data.Point)

type NginxMeasurement

type NginxMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewNginxMeasurement

func NewNginxMeasurement(start time.Time) *NginxMeasurement

func (*NginxMeasurement) ToPoint

func (m *NginxMeasurement) ToPoint(p *data.Point)

type PostgresqlMeasurement

type PostgresqlMeasurement struct {
	*common.SubsystemMeasurement
}

func NewPostgresqlMeasurement

func NewPostgresqlMeasurement(start time.Time) *PostgresqlMeasurement

func (*PostgresqlMeasurement) ToPoint

func (m *PostgresqlMeasurement) ToPoint(p *data.Point)

type RedisMeasurement

type RedisMeasurement struct {
	*common.SubsystemMeasurement
	// contains filtered or unexported fields
}

func NewRedisMeasurement

func NewRedisMeasurement(start time.Time) *RedisMeasurement

func (*RedisMeasurement) Tick

func (m *RedisMeasurement) Tick(d time.Duration)

func (*RedisMeasurement) ToPoint

func (m *RedisMeasurement) ToPoint(p *data.Point)

Jump to

Keyboard shortcuts

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