report

package
v0.0.0-...-730c616 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalPointPool *sync.Pool = &sync.Pool{New: func() interface{} { return &Point{} }}

Functions

func Escape

func Escape(s string) string

func PutPointIntoGlobalPool

func PutPointIntoGlobalPool(p *Point)

func ReportLoadResult

func ReportLoadResult(params *LoadReportParams, totalItems int64, valueRate float64, inputSpeed float64, loadDuration time.Duration, extraVals ...ExtraVal) error

ReportLoadResult send results from bulk load to an influxdb according to the given parameters

func ReportQueryResult

func ReportQueryResult(params *QueryReportParams, queryName string, minQueryTime float64, meanQueryTime float64, maxQueryTime float64, totalQueries int64, queryDuration time.Duration, extraVals ...ExtraVal) error

ReportQueryResult send result from bulk query benchmark to an influxdb according to the given parameters

func TelemetryRunAsync

func TelemetryRunAsync(c *Collector, batchSize uint64, writeToStderr bool, skipN uint64) (src chan *Point, done chan struct{})

TelemetryRunAsync runs a collection loop with many defaults already set. It will abort the program if an error occurs. Assumes points are owned by the GlobalPointPool.

Types

type Collector

type Collector struct {
	Points []*Point
	// contains filtered or unexported fields
}

func NewCollector

func NewCollector(influxhost, dbname, userName, password string) *Collector

func (*Collector) CreateDatabase

func (c *Collector) CreateDatabase() error

func (*Collector) PrepBatch

func (c *Collector) PrepBatch()

func (*Collector) Put

func (c *Collector) Put(p *Point)

func (*Collector) Reset

func (c *Collector) Reset()

func (*Collector) SendBatch

func (c *Collector) SendBatch() error

type ExtraVal

type ExtraVal struct {
	Name  string
	Value interface{}
}

type Field

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

Field represents an InfluxDB field. Users should prefer to keep the strings as long-lived items.

Implementor's note: this type uses more memory than is ideal, but it avoids unsafe and it avoids reflection.

func (*Field) Serialize

func (f *Field) Serialize(w io.Writer)

func (*Field) SetBool

func (f *Field) SetBool(key string, x bool)

func (*Field) SetFloat64

func (f *Field) SetFloat64(key string, x float64)

func (*Field) SetInt64

func (f *Field) SetInt64(key string, x int64)

type LoadReportParams

type LoadReportParams struct {
	ReportParams

	IsGzip    bool
	BatchSize int
}

LoadReportParams is holder of bulk load specific parameters

type Point

type Point struct {
	Measurement   string
	Tags          []Tag
	Fields        []Field
	TimestampNano int64
}

Point wraps an InfluxDB point data. Its primary purpose is to be serialized out to a []byte. Users should prefer to keep the strings as long-lived items.

func GetPointFromGlobalPool

func GetPointFromGlobalPool() *Point

func (*Point) AddBoolField

func (p *Point) AddBoolField(k string, x bool)

func (*Point) AddFloat64Field

func (p *Point) AddFloat64Field(k string, x float64)

func (*Point) AddInt64Field

func (p *Point) AddInt64Field(k string, x int64)

func (*Point) AddIntField

func (p *Point) AddIntField(k string, x int)

func (*Point) AddTag

func (p *Point) AddTag(k, v string)

func (*Point) Init

func (p *Point) Init(m string, ts int64)

func (*Point) Reset

func (p *Point) Reset()

func (*Point) Serialize

func (p *Point) Serialize(w io.Writer)

type QueryReportParams

type QueryReportParams struct {
	ReportParams

	BurnIn int64
}

type QueryReportParams is holder of bulk query specific parameters

type ReportParams

type ReportParams struct {
	DBType             string
	ReportDatabaseName string
	ReportHost         string
	ReportUser         string
	ReportPassword     string
	ReportTags         [][2]string
	Hostname           string
	DestinationUrl     string
	Workers            int
	ItemLimit          int
}

ReportParams is holder for common parameters across load and query reports

type Tag

type Tag struct {
	Key, Value string
}

Tag represents an InfluxDB tag. Users should prefer to keep the strings as long-lived items.

func (*Tag) Serialize

func (t *Tag) Serialize(w io.Writer)

Jump to

Keyboard shortcuts

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