queue

package
v0.0.0-...-c203783 Latest Latest
Warning

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

Go to latest
Published: May 1, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate(awsConfig *aws.Config, queueURL string, totalExpectedRequests uint) chan RegionsAggData

Aggregate listens for results and sends totals, closing the channel when done

Types

type AggData

type AggData struct {
	TotalReqs            int            `json:"total-reqs"`
	TotalTimedOut        int            `json:"total-timed-out"`
	TotalConnectionError int            `json:"total-conn-error"`
	AveTimeToFirst       int64          `json:"ave-time-to-first"`
	TotBytesRead         int            `json:"tot-bytes-read"`
	Statuses             map[string]int `json:"statuses"`
	AveTimeForReq        int64          `json:"ave-time-for-req"`
	AveReqPerSec         float32        `json:"ave-req-per-sec"`
	AveKBytesPerSec      float32        `json:"ave-kbytes-per-sec"`
	Slowest              int64          `json:"slowest"`
	Fastest              int64          `json:"fastest"`
	Region               string         `json:"region"`
	FatalError           string         `json:"fatal-error"`
}

AggData type

func SumRegionResults

func SumRegionResults(regionData *RegionsAggData) *AggData

SumRegionResults adds all the results together

type DummyAdaptor

type DummyAdaptor struct {
	QueueURL string
}

DummyAdaptor is used to send messages to the screen for testing

func NewDummyAdaptor

func NewDummyAdaptor(queueURL string) *DummyAdaptor

NewDummyAdaptor returns a new sqs adator object

func (DummyAdaptor) SendResult

func (adaptor DummyAdaptor) SendResult(result AggData)

SendResult prints the result

type RegionsAggData

type RegionsAggData struct {
	Regions               map[string]AggData
	TotalExpectedRequests uint
}

RegionsAggData type

type Result

type Result struct {
	Time             string `json:"time"`
	Host             string `json:"host"`
	Type             string `json:"type"`
	Status           int    `json:"status"`
	ElapsedFirstByte int64  `json:"elapsed-first-byte"`
	ElapsedLastByte  int64  `json:"elapsed-last-byte"`
	Elapsed          int64  `json:"elapsed"`
	Bytes            int    `json:"bytes"`
	State            string `json:"state"`
	Instance         string `json:"instance"`
}

Result test result

type SQSAdaptor

type SQSAdaptor struct {
	Client   *sqs.SQS
	QueueURL string
}

SQSAdaptor is used to send messages to the queue

func NewSQSAdaptor

func NewSQSAdaptor(awsConfig *aws.Config, queueURL string) *SQSAdaptor

NewSQSAdaptor returns a new sqs adator object

func (SQSAdaptor) Receive

func (adaptor SQSAdaptor) Receive() *AggData

Receive a result, or timeout in 1 second

func (SQSAdaptor) SendResult

func (adaptor SQSAdaptor) SendResult(result AggData)

SendResult adds a result to the queue

Jump to

Keyboard shortcuts

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