handlers

package
v0.0.0-...-d2cf98a Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BatchSize = 1000
)

Variables

View Source
var (
	AggregateNames = []string{"24h", "6h", "1h", "10m", "1m"}
)
View Source
var (
	EarliestPlausibleTime = time.Date(2018, 1, 1, 0, 0, 0, 0, time.UTC)
)

Functions

func Logger

func Logger(ctx context.Context) *zap.Logger

func NewStationModelRecordHandler

func NewStationModelRecordHandler(db *sqlxcache.DB) *stationModelRecordHandler

Types

type AggregateSensorKey

type AggregateSensorKey struct {
	SensorKey string
	ModuleID  int64
}

type AggregationFunction

type AggregationFunction interface {
	Apply(values []float64) (float64, error)
}

type AverageFunction

type AverageFunction struct {
}

func (*AverageFunction) Apply

func (f *AverageFunction) Apply(values []float64) (float64, error)

type InterestingnessHandler

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

func NewInterestingnessHandler

func NewInterestingnessHandler(db *sqlxcache.DB) *InterestingnessHandler

func (*InterestingnessHandler) Close

func (*InterestingnessHandler) ConsiderReading

func (ih *InterestingnessHandler) ConsiderReading(ctx context.Context, r *data.IncomingReading) error

type MaximumFunction

type MaximumFunction struct {
}

func (*MaximumFunction) Apply

func (f *MaximumFunction) Apply(values []float64) (float64, error)

type SensorAndModulePosition

type SensorAndModulePosition struct {
	ConfigurationID int64  `db:"configuration_id"`
	SensorID        int64  `db:"sensor_id"`
	ModuleIndex     uint32 `db:"module_index"`
	SensorIndex     uint32 `db:"sensor_index"`
}

type TsDBHandler

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

func NewTsDbHandler

func NewTsDbHandler(db *sqlxcache.DB, tsConfig *storage.TimeScaleDBConfig, publisher jobs.MessagePublisher, completions *jobs.CompletionIDs) *TsDBHandler

func (*TsDBHandler) OnData

func (v *TsDBHandler) OnData(ctx context.Context, provision *data.Provision, rawData *pb.DataRecord, rawMeta *pb.DataRecord, db *data.DataRecord, meta *data.MetaRecord) error

func (*TsDBHandler) OnDone

func (v *TsDBHandler) OnDone(ctx context.Context) error

func (*TsDBHandler) OnMeta

func (v *TsDBHandler) OnMeta(ctx context.Context, provision *data.Provision, rawMeta *pb.DataRecord, meta *data.MetaRecord) error

type UpdateSensorValue

type UpdateSensorValue struct {
	ID    int64     `db:"id"`
	Value float64   `db:"reading_last"`
	Time  time.Time `db:"reading_time"`
}

Jump to

Keyboard shortcuts

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