vehicle

package
v0.0.0-...-730c616 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const NVehicleSims = 1

Mark 表的数量

Variables

View Source
var (
	// The duration of a log epoch.
	EpochDuration = 1 * time.Second

	// Tag fields common to all inside sensors:
	RoomTagKey = []byte("room_id")

	// Tag fields common to all inside sensors:
	SensorHomeTagKeys = [][]byte{
		[]byte("sensor_id"),
		[]byte("home_id"),
	}

	DefaultVehicleDateTimeStart = "2018-01-01T00:00:00Z"
	DefaultVehicleDateTimeEnd   = "2018-01-01T00:00:01Z"
)
View Source
var (
	EntityByteString      = []byte("vehicle")       // heap optimization
	EntityTotalByteString = []byte("vehicle-total") // heap optimization
)
View Source
var (
	// Field keys for 'vehicle entity' points.
	EntityFieldKeys = [][]byte{
		[]byte("value1"),
		[]byte("value2"),
		[]byte("value3"),
		[]byte("value4"),
		[]byte("value5"),
		[]byte("value6"),
		[]byte("value7"),
		[]byte("value8"),
		[]byte("value9"),
		[]byte("value10"),
		[]byte("value11"),
		[]byte("value12"),
		[]byte("value13"),
		[]byte("value14"),
		[]byte("value15"),
		[]byte("value16"),
		[]byte("value17"),
		[]byte("value18"),
		[]byte("value19"),
		[]byte("value20"),
		[]byte("value21"),
		[]byte("value22"),
		[]byte("value23"),
		[]byte("value24"),
		[]byte("value25"),
		[]byte("value26"),
		[]byte("value27"),
		[]byte("value28"),
		[]byte("value29"),
		[]byte("value30"),
		[]byte("value31"),
		[]byte("value32"),
		[]byte("value33"),
		[]byte("value34"),
		[]byte("value35"),
		[]byte("value36"),
		[]byte("value37"),
		[]byte("value38"),
		[]byte("value39"),
		[]byte("value40"),
		[]byte("value41"),
		[]byte("value42"),
		[]byte("value43"),
		[]byte("value44"),
		[]byte("value45"),
		[]byte("value46"),
		[]byte("value47"),
		[]byte("value48"),
		[]byte("value49"),
		[]byte("value50"),
		[]byte("value51"),
		[]byte("value52"),
		[]byte("value53"),
		[]byte("value54"),
		[]byte("value55"),
		[]byte("value56"),
		[]byte("value57"),
		[]byte("value58"),
		[]byte("value59"),
		[]byte("value60"),
	}
)

Functions

func NewHostMeasurements

func NewHostMeasurements(start time.Time) []SimulatedMeasurement

Types

type EntityMeasurement

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

func NewEntityMeasurement

func NewEntityMeasurement(start time.Time) *EntityMeasurement

func (*EntityMeasurement) Tick

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

func (*EntityMeasurement) ToPoint

func (m *EntityMeasurement) ToPoint(p *Point) bool

type Vehicle

type Vehicle struct {
	SimulatedMeasurements []SimulatedMeasurement

	// These are all assigned once, at Host creation:
	Name []byte
}

Type Host models a machine being monitored by Telegraf.

func NewVehicle

func NewVehicle(i int, offset int, start time.Time) Vehicle

func (*Vehicle) NumMeasurements

func (v *Vehicle) NumMeasurements() int

func (*Vehicle) TickAll

func (v *Vehicle) TickAll(d time.Duration)

TickAll advances all Distributions of a Host.

type VehicleSimulator

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

A IotSimulator generates data similar to telemetry from Telegraf. It fulfills the Simulator interface.

func (*VehicleSimulator) Finished

func (g *VehicleSimulator) Finished() bool

func (*VehicleSimulator) Next

func (v *VehicleSimulator) Next(p *Point)

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

func (*VehicleSimulator) SeenPoints

func (g *VehicleSimulator) SeenPoints() int64

func (*VehicleSimulator) SeenValues

func (g *VehicleSimulator) SeenValues() int64

func (*VehicleSimulator) Total

func (g *VehicleSimulator) Total() int64

type VehicleSimulatorConfig

type VehicleSimulatorConfig struct {
	Start time.Time
	End   time.Time

	VehicleCount  int64
	VehicleOffset int64

	StartVinIndex int
}

Type IotSimulatorConfig is used to create a IotSimulator.

func (*VehicleSimulatorConfig) ToSimulator

func (d *VehicleSimulatorConfig) ToSimulator() *VehicleSimulator

Jump to

Keyboard shortcuts

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