streamer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Origin = ""

Functions

func Configure

func Configure(pID int, rID string, rowsParam string, startTime int, endTime int, dataPointCount int, w http.ResponseWriter)

func StreamData

func StreamData(pID int, rID string, fillDataRow func(string, map[string]interface{}))

StreamData starts data streaming using the respective ticker stored in configMap. This function shall be called from a REST request handler function Based on the parsed parameters of the request the configMap is extended. Structure of config map:

Panel -> queries/panel -> series/queries

At the moment each query has its own ticker channel setup based on the sampling time (calculated based on the grafana data points config) Each series is represented by a string that can be configured in grafana through the dataText field. Once the ticker is set, the respective query results will be streamed back (periodical http flush) to the grafana server.

Types

type QueryConfig

type QueryConfig struct {
	Writer http.ResponseWriter
	Series []string
	Ticker *time.Ticker
}

Jump to

Keyboard shortcuts

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