continuousquery

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultReportTime is the default time interval for reporting stats.
	DefaultReportTime     = 5 * time.Minute
	DefaultChunkSize      = 10000
	DefaultInnerChunkSize = 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContinuousQuery

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

func NewContinuousQuery

func NewContinuousQuery(rp string, query string) *ContinuousQuery

NewContinuousQuery returns a ContinuousQuery object with a parsed SQL statement.

type MetaClient

type MetaClient interface {
	SendSql2MetaHeartbeat(host string) error
	WaitForDataChanged() chan struct{}
	GetMaxCQChangeID() uint64
	Databases() map[string]*meta.DatabaseInfo
	GetCqLease(host string) ([]string, error)
	BatchUpdateContinuousQueryStat(cqStats map[string]int64) error
}

type QueryExecutor

type QueryExecutor interface {
	ExecuteQuery(query *influxql.Query, opt query.ExecutionOptions, closing chan struct{}, qDuration *statistics.SQLSlowQueryStatistics) <-chan *query2.Result
}

type Service

type Service struct {
	MetaClient MetaClient // interface for MetaClient

	QueryExecutor QueryExecutor // interface for QueryExecutor

	ContinuousQueries []*ContinuousQuery
	// contains filtered or unexported fields
}

Service represents a service for managing continuous queries.

func NewService

func NewService(hostname string, interval time.Duration, number int) *Service

NewService creates a new Service instance named continuousQuery

func (*Service) Close

func (s *Service) Close() error

func (*Service) ExecuteContinuousQuery

func (s *Service) ExecuteContinuousQuery(cq *ContinuousQuery, now time.Time) (bool, error)

ExecuteContinuousQuery may execute a single CQ. This will return false if there were no errors and the CQ was not run.

func (*Service) Open

func (s *Service) Open() error

func (*Service) WithLogger

func (s *Service) WithLogger(logger *logger.Logger)

Jump to

Keyboard shortcuts

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