impl

package
v0.0.0-...-fb52b37 Latest Latest
Warning

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

Go to latest
Published: May 8, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpEngine

func NewHttpEngine(config core.ChukonuConfig) core.Engine

Types

type ChukonuHttpRequest

type ChukonuHttpRequest struct {
	*http.Request
	// contains filtered or unexported fields
}

func NewChukonuHttpRequest

func NewChukonuHttpRequest(name string,
	timeout time.Duration,
	followRedirect bool,
	keepAlive bool,
	postProcess func(context.Context, core.ChukonuResponse) context.Context,
	validate func(core.ChukonuRequest, core.ChukonuResponse) bool,
	req *http.Request) ChukonuHttpRequest

func (ChukonuHttpRequest) Dump

func (c ChukonuHttpRequest) Dump() ([]byte, error)

TODO: reconsider the body=true param

func (ChukonuHttpRequest) ID

func (c ChukonuHttpRequest) ID() uuid.UUID

func (ChukonuHttpRequest) Name

func (c ChukonuHttpRequest) Name() string

func (ChukonuHttpRequest) PostProcessor

func (ChukonuHttpRequest) RawRequest

func (c ChukonuHttpRequest) RawRequest() interface{}

func (ChukonuHttpRequest) Timeout

func (c ChukonuHttpRequest) Timeout() time.Duration

func (ChukonuHttpRequest) Validator

type ChukonuHttpResponse

type ChukonuHttpResponse struct {
	*http.Response
	// contains filtered or unexported fields
}

func (ChukonuHttpResponse) Dump

func (c ChukonuHttpResponse) Dump() ([]byte, error)

TODO: reconsider the body=false param, set to false now because body would be closed early somewhere before dump is called

func (ChukonuHttpResponse) Duration

func (c ChukonuHttpResponse) Duration() time.Duration

func (ChukonuHttpResponse) ID

func (c ChukonuHttpResponse) ID() uuid.UUID

func (ChukonuHttpResponse) RawResponse

func (c ChukonuHttpResponse) RawResponse() interface{}

func (ChukonuHttpResponse) Size

func (c ChukonuHttpResponse) Size() int64

func (ChukonuHttpResponse) Status

func (c ChukonuHttpResponse) Status() string

type HttpEngine

type HttpEngine struct {
	http.Client
	// contains filtered or unexported fields
}

func (*HttpEngine) ResetState

func (e *HttpEngine) ResetState() error

func (*HttpEngine) RunRequest

func (e *HttpEngine) RunRequest(request core.ChukonuRequest) (core.ChukonuResponse, error)

type HttpMetricsManager

type HttpMetricsManager struct {

	//locks
	sync.Mutex
	// contains filtered or unexported fields
}

func NewHttpMetricsManager

func NewHttpMetricsManager() *HttpMetricsManager

func (*HttpMetricsManager) DownloadSnapshot

func (m *HttpMetricsManager) DownloadSnapshot()

func (*HttpMetricsManager) DumpToDisk

func (m *HttpMetricsManager) DumpToDisk()

Data for each response shoud be periodically dump to disk

func (*HttpMetricsManager) GetDurationAt

func (m *HttpMetricsManager) GetDurationAt(thres []int) []time.Duration

return the sampletime(duration) at input percentile

func (*HttpMetricsManager) GetErrorQueue

func (m *HttpMetricsManager) GetErrorQueue() chan error

func (*HttpMetricsManager) GetMeanDuration

func (m *HttpMetricsManager) GetMeanDuration() time.Duration

func (*HttpMetricsManager) GetRequestQueue

func (m *HttpMetricsManager) GetRequestQueue() chan core.ChukonuRequest

func (*HttpMetricsManager) GetResponseQueue

func (m *HttpMetricsManager) GetResponseQueue() chan core.ChukonuResponse

func (*HttpMetricsManager) GetThroughput

func (m *HttpMetricsManager) GetThroughput() int

func (*HttpMetricsManager) GetThroughputQueue

func (m *HttpMetricsManager) GetThroughputQueue() chan int

func (*HttpMetricsManager) MeasureThroughput

func (m *HttpMetricsManager) MeasureThroughput()

func (*HttpMetricsManager) RecordError

func (m *HttpMetricsManager) RecordError(err error)

func (*HttpMetricsManager) RecordRequest

func (m *HttpMetricsManager) RecordRequest(request core.ChukonuRequest)

func (*HttpMetricsManager) RecordResponse

func (m *HttpMetricsManager) RecordResponse(response core.ChukonuResponse)

func (*HttpMetricsManager) RecordThroughput

func (m *HttpMetricsManager) RecordThroughput(t float64)

func (*HttpMetricsManager) SampleMetrics

func (m *HttpMetricsManager) SampleMetrics()

TODO: debounce instead of fixed ticking, because some metrics collection may take longer than 1 sec

func (*HttpMetricsManager) SetConsulConfig

func (m *HttpMetricsManager) SetConsulConfig(tenantId string, cid string, consulAddress string)

func (*HttpMetricsManager) StartRecording

func (m *HttpMetricsManager) StartRecording() (chan int, chan core.ChukonuRequest, chan core.ChukonuResponse, chan error)

func (*HttpMetricsManager) UploadSnapshot

func (m *HttpMetricsManager) UploadSnapshot()

type Snapshot

type Snapshot struct {
	RequestSent int
	DurationSum time.Duration
	NumErrors   int
	NumRecords  int
	Histogram   map[time.Duration]int
}

Jump to

Keyboard shortcuts

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