statement - ActiveState ActiveGo 1.8
...

Package statement

import "github.com/influxdata/influxdb/stress/v2/statement"
Overview
Index

Overview ▾

Index ▾

type ExecStatement
    func (i *ExecStatement) Report(s *stressClient.StressTest) string
    func (i *ExecStatement) Run(s *stressClient.StressTest)
    func (i *ExecStatement) SetID(s string)
type Function
    func (f *Function) NewStringer(series int) Stringer
type GoStatement
    func (i *GoStatement) Report(s *stressClient.StressTest) string
    func (i *GoStatement) Run(s *stressClient.StressTest)
    func (i *GoStatement) SetID(s string)
type InfluxqlStatement
    func (i *InfluxqlStatement) Report(s *stressClient.StressTest) (out string)
    func (i *InfluxqlStatement) Run(s *stressClient.StressTest)
    func (i *InfluxqlStatement) SetID(s string)
type InsertStatement
    func (i *InsertStatement) Report(s *stressClient.StressTest) string
    func (i *InsertStatement) Run(s *stressClient.StressTest)
    func (i *InsertStatement) SetID(s string)
    func (i *InsertStatement) SetVars(s *stressClient.StressTest) chan<- string
type QueryStatement
    func (i *QueryStatement) Report(s *stressClient.StressTest) string
    func (i *QueryStatement) Run(s *stressClient.StressTest)
    func (i *QueryStatement) SetID(s string)
type ResponseTime
    func NewResponseTime(v int) ResponseTime
type ResponseTimes
    func (rs ResponseTimes) Len() int
    func (rs ResponseTimes) Less(i, j int) bool
    func (rs ResponseTimes) Swap(i, j int)
type SetStatement
    func (i *SetStatement) Report(s *stressClient.StressTest) string
    func (i *SetStatement) Run(s *stressClient.StressTest)
    func (i *SetStatement) SetID(s string)
type Statement
type Stringer
    func NewFloatFunc(fn string, arg int) Stringer
    func NewIntFunc(fn string, arg int) Stringer
    func NewStrFunc(fn string, arg int) Stringer
type Stringers
    func (s Stringers) Eval(time func() int64) []interface{}
type Template
    func (t *Template) NewTagFunc() Stringer
type Templates
    func (t Templates) Init(seriesCount int) Stringers
type Timestamp
    func (t *Timestamp) Time(startDate string, series int, precision string) func() int64
type WaitStatement
    func (w *WaitStatement) Report(s *stressClient.StressTest) string
    func (w *WaitStatement) Run(s *stressClient.StressTest)
    func (w *WaitStatement) SetID(s string)

Package files

exec.go function.go go.go influxql.go insert.go query.go report.go response_time.go set.go statement.go template.go timestamp.go wait.go

type ExecStatement

ExecStatement run outside scripts. This functionality is not built out TODO: Wire up!

type ExecStatement struct {
    StatementID string
    Script      string
    // contains filtered or unexported fields
}

func (*ExecStatement) Report

func (i *ExecStatement) Report(s *stressClient.StressTest) string

Report statisfies the Statement Interface

func (*ExecStatement) Run

func (i *ExecStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*ExecStatement) SetID

func (i *ExecStatement) SetID(s string)

SetID statisfies the Statement Interface

type Function

Function is a struct that holds information for generating values in templated points

type Function struct {
    Type     string
    Fn       string
    Argument int
    Count    int
}

func (*Function) NewStringer

func (f *Function) NewStringer(series int) Stringer

NewStringer creates a new Stringer

type GoStatement

GoStatement is a Statement Implementation to allow other statements to be run concurrently

type GoStatement struct {
    Statement

    StatementID string
}

func (*GoStatement) Report

func (i *GoStatement) Report(s *stressClient.StressTest) string

Report statisfies the Statement Interface

func (*GoStatement) Run

func (i *GoStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*GoStatement) SetID

func (i *GoStatement) SetID(s string)

SetID statisfies the Statement Interface

type InfluxqlStatement

InfluxqlStatement is a Statement Implementation that allows statements that parse in InfluxQL to be passed directly to the target instance

type InfluxqlStatement struct {
    StatementID string
    Query       string
    Tracer      *stressClient.Tracer
}

func (*InfluxqlStatement) Report

func (i *InfluxqlStatement) Report(s *stressClient.StressTest) (out string)

Report statisfies the Statement Interface No test coverage, fix

func (*InfluxqlStatement) Run

func (i *InfluxqlStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*InfluxqlStatement) SetID

func (i *InfluxqlStatement) SetID(s string)

SetID statisfies the Statement Interface

type InsertStatement

InsertStatement is a Statement Implementation that creates points to be written to the target InfluxDB instance

type InsertStatement struct {
    TestID      string
    StatementID string

    // Statement Name
    Name string

    // Template string for points. Filled by the output of stringers
    TemplateString string

    // TagCount is used to find the number of series in the dataset
    TagCount int

    // The Tracer prevents InsertStatement.Run() from returning early
    Tracer *stressClient.Tracer

    // Timestamp is #points to write and percision
    Timestamp *Timestamp

    // Templates turn into stringers
    Templates Templates

    // Concurrency utiliities
    sync.WaitGroup
    sync.Mutex
    // contains filtered or unexported fields
}

func (*InsertStatement) Report

func (i *InsertStatement) Report(s *stressClient.StressTest) string

Report statisfies the Statement Interface

func (*InsertStatement) Run

func (i *InsertStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*InsertStatement) SetID

func (i *InsertStatement) SetID(s string)

SetID statisfies the Statement Interface

func (*InsertStatement) SetVars

func (i *InsertStatement) SetVars(s *stressClient.StressTest) chan<- string

SetVars sets up the environment for InsertStatement to call it's Run function

type QueryStatement

QueryStatement is a Statement Implementation to run queries on the target InfluxDB instance

type QueryStatement struct {
    StatementID string
    Name        string

    // TemplateString is a query template that can be filled in by Args
    TemplateString string
    Args           []string

    // Number of queries to run
    Count int

    // Tracer for tracking returns
    Tracer *stressClient.Tracer
    // contains filtered or unexported fields
}

func (*QueryStatement) Report

func (i *QueryStatement) Report(s *stressClient.StressTest) string

Report statisfies the Statement Interface

func (*QueryStatement) Run

func (i *QueryStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*QueryStatement) SetID

func (i *QueryStatement) SetID(s string)

SetID statisfies the Statement Interface

type ResponseTime

ResponseTime is a struct that contains `Value` `Time` pairing.

type ResponseTime struct {
    Value int
    Time  time.Time
}

func NewResponseTime

func NewResponseTime(v int) ResponseTime

NewResponseTime returns a new response time with value `v` and time `time.Now()`.

type ResponseTimes

ResponseTimes is a slice of response times

type ResponseTimes []ResponseTime

func (ResponseTimes) Len

func (rs ResponseTimes) Len() int

Implements the `Len` method for the sort.Interface type

func (ResponseTimes) Less

func (rs ResponseTimes) Less(i, j int) bool

Implements the `Less` method for the sort.Interface type

func (ResponseTimes) Swap

func (rs ResponseTimes) Swap(i, j int)

Implements the `Swap` method for the sort.Interface type

type SetStatement

SetStatement set state variables for the test

type SetStatement struct {
    Var   string
    Value string

    StatementID string

    Tracer *stressClient.Tracer
}

func (*SetStatement) Report

func (i *SetStatement) Report(s *stressClient.StressTest) string

Report statisfies the Statement Interface

func (*SetStatement) Run

func (i *SetStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*SetStatement) SetID

func (i *SetStatement) SetID(s string)

SetID statisfies the Statement Interface

type Statement

Statement is the common interface to shape the testing environment and prepare database requests The parser turns the 'statements' in the config file into Statements

type Statement interface {
    Run(s *stressClient.StressTest)
    Report(s *stressClient.StressTest) string
    SetID(s string)
}

type Stringer

Stringer is a function that returns a string

type Stringer func() string

func NewFloatFunc

func NewFloatFunc(fn string, arg int) Stringer

NewFloatFunc reates a new striger to create float values for templated writes

func NewIntFunc

func NewIntFunc(fn string, arg int) Stringer

NewIntFunc reates a new striger to create int values for templated writes

func NewStrFunc

func NewStrFunc(fn string, arg int) Stringer

NewStrFunc reates a new striger to create strings for templated writes

type Stringers

Stringers is a collection of Stringer

type Stringers []Stringer

func (Stringers) Eval

func (s Stringers) Eval(time func() int64) []interface{}

Eval returns an array of all the Stringer functions evaluated once

type Template

A Template contains all information to fill in templated variables in inset and query statements

type Template struct {
    Tags     []string
    Function *Function
}

func (*Template) NewTagFunc

func (t *Template) NewTagFunc() Stringer

NewTagFunc returns a Stringer that loops through the given tags

type Templates

Templates are a collection of Template

type Templates []*Template

func (Templates) Init

func (t Templates) Init(seriesCount int) Stringers

Init makes Stringers out of the Templates for quick point creation

type Timestamp

A Timestamp contains all informaiton needed to generate timestamps for points created by InsertStatements

type Timestamp struct {
    Count    int
    Duration time.Duration
    Jitter   bool
}

func (*Timestamp) Time

func (t *Timestamp) Time(startDate string, series int, precision string) func() int64

Time returns the next timestamp needed by the InsertStatement

type WaitStatement

WaitStatement is a Statement Implementation to prevent the test from returning to early when running GoStatements

type WaitStatement struct {
    StatementID string
    // contains filtered or unexported fields
}

func (*WaitStatement) Report

func (w *WaitStatement) Report(s *stressClient.StressTest) string

Report statisfies the Statement Interface

func (*WaitStatement) Run

func (w *WaitStatement) Run(s *stressClient.StressTest)

Run statisfies the Statement Interface

func (*WaitStatement) SetID

func (w *WaitStatement) SetID(s string)

SetID statisfies the Statement Interface