tsdb

package
v0.1.4-dev Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TSDataFormatTimeSerial = "time_serial"
)

Variables

This section is empty.

Functions

func CreateHyperTable

func CreateHyperTable(db *gorm.DB, tableName string, dataRetentionPeriod time.Duration) error

func CreateHyperTableAvgValuesView

func CreateHyperTableAvgValuesView(db *gorm.DB, tableName string, viewName string, timeBucket string,
	nameColumn string, valueColumn string, indexColumns []string, names []string, where string) error

func CreateHyperTableCountView

func CreateHyperTableCountView(db *gorm.DB, tableName string, viewName string, timeBucket string, indexColumns []string) error

func DropHyperTableView

func DropHyperTableView(db *gorm.DB, viewName string) error

func SetDataRetentionPolicyForHyperTalbe

func SetDataRetentionPolicyForHyperTalbe(db *gorm.DB, tableName string, duration time.Duration) error

Types

type TSDataFormat

type TSDataFormat string

type TSPoint

type TSPoint map[string]TSPointValue

type TSPointValue

type TSPointValue any

type TSQuery

type TSQuery struct {
	Id           string            `json:"Id"`
	Source       string            `json:"Source"`
	Interval     float64           `json:"Interval"`
	Format       TSDataFormat      `json:"Format"`
	Select       []TSQuerySelect   `json:"Select"`
	GroupBy      []string          `json:"GroupBy"`
	OrderBy      []string          `json:"OrderBy"`
	Reverse      bool              `json:"Reverse"`
	SearchString string            `json:"Search"`
	Search       search.SearchData `json:"-"`
	Limit        int               `json:"Limit"`
	Offset       int               `json:"Offset"`
}

type TSQueryCommand

type TSQueryCommand struct {
	Schema   string  `json:"-"`
	From     int64   `json:"From"`
	To       int64   `json:"To"`
	Query    TSQuery `json:"Query"`
	TimeZone string  `json:"TimeZone"`
}

type TSQuerySelect

type TSQuerySelect struct {
	Name   string `json:"Name"`
	Source string `json:"Source"`
	Func   string `json:"Func"`
}

type TSResult

type TSResult struct {
	From int64      `json:"From"`
	To   int64      `json:"To"`
	Data []TSSeries `json:"Data"`
}

func HandleTSQueryCommand

func HandleTSQueryCommand(db *gorm.DB, cmd TSQueryCommand) (TSResult, error)

type TSSeries

type TSSeries struct {
	Points  []TSPoint         `json:"Points"`
	GroupBy map[string]string `json:"GroupBy,omitempty"`
}

func QueryTimeSeries

func QueryTimeSeries(db *gorm.DB, from int64, to int64, tz string, query TSQuery) ([]TSSeries, error)

Jump to

Keyboard shortcuts

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