ponyExpress

package
v1.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2016 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrencyLimiter

type ConcurrencyLimiter struct {
	sync.Mutex
	// contains filtered or unexported fields
}

ConcurrencyLimiter ensures that no more than a specified max number of goroutines are running.

func NewConcurrencyLimiter

func NewConcurrencyLimiter(max int) *ConcurrencyLimiter

NewConcurrencyLimiter returns a configured limiter that will ensure that calls to Increment will block if the max is hit.

func (*ConcurrencyLimiter) Decrement

func (c *ConcurrencyLimiter) Decrement()

Decrement will reduce the count of running goroutines by 1

func (*ConcurrencyLimiter) Increment

func (c *ConcurrencyLimiter) Increment()

Increment will increase the count of running goroutines by 1. if the number is currently at the max, the call to Increment will block until another goroutine decrements.

func (*ConcurrencyLimiter) NewMax

func (c *ConcurrencyLimiter) NewMax(i int)

NewMax resets the max of a ConcurrencyLimiter.

type Directive

type Directive struct {
	Property string
	Value    string
	Tracer   *Tracer
}

Directive is a struct to enable communication between SetStatements and the ponyExpress backend Directives change state for the stress test

func NewDirective

func NewDirective(property string, value string, tracer *Tracer) Directive

NewDirective creates a new instance of a Directive with the appropriate state variable to change

type Package

type Package struct {
	T           Type
	Body        []byte
	StatementID string
	Tracer      *Tracer
}

Package is a struct to enable communication between InsertStatements, QueryStatements and InfluxQLStatements and the ponyExpress backend Packages carry either writes or queries in the []byte that makes up the Body

func NewPackage

func NewPackage(t Type, body []byte, statementID string, tracer *Tracer) Package

NewPackage creates a new package with the appropriate payload

type Response

type Response struct {
	Point  *influx.Point
	Tracer *Tracer
}

Response holds data scraped from InfluxDB HTTP responses turned into a *influx.Point for reporting See reporting.go for more information The Tracer contains a wait group sent from the statement. It needs to be decremented when the Response is consumed

func NewResponse

func NewResponse(pt *influx.Point, tr *Tracer) Response

NewResponse creates a new instance of Response

func (Response) AddTags

func (resp Response) AddTags(newTags map[string]string) *influx.Point

AddTags adds additional tags to the point held in Response and returns the point

type StoreFront

type StoreFront struct {
	TestID   string
	TestName string

	Precision string
	StartDate string
	BatchSize int

	sync.WaitGroup
	sync.Mutex

	ResultsChan chan Response

	ResultsClient influx.Client
	// contains filtered or unexported fields
}

The StoreFront is the Statement facing API that consume Statement output and coordinates the test results

func NewStoreFront

func NewStoreFront() *StoreFront

NewStoreFront creates the backend for the stress test

func NewTestStoreFront

func NewTestStoreFront() (*StoreFront, chan Package, chan Directive)

NewTestStoreFront returns a StoreFront to be used for testing Statements

func (*StoreFront) GetPoint

func (sf *StoreFront) GetPoint(name, precision string) models.Point

GetPoint is called by a QueryStatement and retrieves a point sent by the associated InsertStatement

func (*StoreFront) GetStatementResults

func (sf *StoreFront) GetStatementResults(sID, t string) (res []influx.Result)

GetStatementResults is a convinence function for fetching all results given a StatementID

func (*StoreFront) SendDirective

func (sf *StoreFront) SendDirective(d Directive)

SendDirective is the public facing API to set state variables in the test

func (*StoreFront) SendPackage

func (sf *StoreFront) SendPackage(p Package)

SendPackage is the public facing API for to send Queries and Points

func (*StoreFront) SetCommune

func (sf *StoreFront) SetCommune(name string) chan<- string

SetCommune creates a new commune on the StoreFront

func (*StoreFront) SetResultsClient

func (sf *StoreFront) SetResultsClient(conf influx.HTTPConfig)

SetResultsClient is the utility for reseting the address of the ResultsClient

type Tracer

type Tracer struct {
	Tags map[string]string

	sync.WaitGroup
}

The Tracer carrys tags and a waitgroup from the statements through the package life cycle

func NewTracer

func NewTracer(tags map[string]string) *Tracer

NewTracer returns a Tracer with tags attached

type Type

type Type int

Type refers to the different Package types

const (
	Write Type = iota
	Query
)

There are two package types, Write and Query

Jump to

Keyboard shortcuts

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