iot

package
v0.0.0-...-c8f6ff2 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// FleetChoices contains all the fleet name values for the IoT use case
	FleetChoices = []string{
		"East",
		"West",
		"North",
		"South",
	}
)

Functions

func NewTruck

func NewTruck(i int, start time.Time) common.Generator

NewTruck creates a new truck in a simulated iot use case

Types

type DiagnosticsMeasurement

type DiagnosticsMeasurement struct {
	*common.SubsystemMeasurement
}

DiagnosticsMeasurement represents a diagnostics subset of measurements.

func NewDiagnosticsMeasurement

func NewDiagnosticsMeasurement(start time.Time) *DiagnosticsMeasurement

NewDiagnosticsMeasurement creates a DiagnosticsMeasurement with start time.

func (*DiagnosticsMeasurement) ToPoint

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

ToPoint serializes DiagnosticsMeasurement to generate.Point.

type ReadingsMeasurement

type ReadingsMeasurement struct {
	*common.SubsystemMeasurement
}

ReadingsMeasurement represents a subset of truck measurement readings.

func NewReadingsMeasurement

func NewReadingsMeasurement(start time.Time) *ReadingsMeasurement

NewReadingsMeasurement creates a new ReadingsMeasurement with start time.

func (*ReadingsMeasurement) ToPoint

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

ToPoint serializes ReadingsMeasurement to serialize.Point.

type Simulator

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

Simulator is responsible for simulating entries for the IoT use case. It will run on batches of entries and apply the generated batch configuration which it gets from the config generator. That way it can introduce things like missing entries or batches, out of order entries or batches etc.

func (Simulator) Fields

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

Fields returns the fields of an entry.

func (Simulator) Finished

func (s Simulator) Finished() bool

Finished checks if the simulator is done.

func (*Simulator) Headers

func (s *Simulator) Headers() *common.GeneratedDataHeaders

func (*Simulator) Next

func (s *Simulator) Next(p *data.Point) bool

Next populates the serialize.Point with the next entry from the batch. If the current pregenerated batch is empty, it tries to generate a new one in order to populate the next entry.

func (Simulator) TagKeys

func (s Simulator) TagKeys() []string

TagKeys returns the tag keys of an entry.

func (Simulator) TagTypes

func (s Simulator) TagTypes() []string

TagTypes returns the data types for the tags of an entry.

type SimulatorConfig

type SimulatorConfig common.BaseSimulatorConfig

SimulatorConfig is used to create an IoT Simulator. It fulfills the common.SimulatorConfig interface.

func (*SimulatorConfig) NewSimulator

func (sc *SimulatorConfig) NewSimulator(interval time.Duration, limit uint64) common.Simulator

NewSimulator produces an IoT Simulator with the given config over the specified interval and points limit.

type Truck

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

Truck models a truck outfitted with an IoT device which sends back measurements.

func (Truck) Measurements

func (t Truck) Measurements() []common.SimulatedMeasurement

Measurements returns the trucks measurements.

func (Truck) Tags

func (t Truck) Tags() []common.Tag

Tags returns the truck tags.

func (*Truck) TickAll

func (t *Truck) TickAll(d time.Duration)

TickAll advances all Distributions of a Truck.

Jump to

Keyboard shortcuts

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