Documentation ¶
Index ¶
Constants ¶
View Source
const (
MicrosecondsInOneSecond = 1e6
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChukonuConfig ¶
type ChukonuConfig struct { TenantId string `json:"tenantId"` Concurrency int `json:"concurrency"` Iterations int `json:"iterations"` TotalTimeout time.Duration `json:"totalTimeout"` RequestTimeout time.Duration `json:"requestTimeout"` EngineSpec map[string]interface{} `json:"engineSpec"` }
should be able to represent as json
type ChukonuRequest ¶
type ChukonuRequest interface { ID() uuid.UUID Name() string // name of a type of request RawRequest() interface{} Timeout() time.Duration Validator() func(ChukonuRequest, ChukonuResponse) bool PostProcessor() func(context.Context, ChukonuResponse) context.Context Dump() ([]byte, error) }
type ChukonuResponse ¶
type ChukonuWorkflow ¶
type ChukonuWorkflow struct { Name string // name of a type of workflow Ctx context.Context Requests []func(context.Context) ChukonuRequest // contains filtered or unexported fields }
A flow of requests that will be run sequentially in order by one goroutine
func NewWorkflow ¶
func NewWorkflow(name string) *ChukonuWorkflow
func (*ChukonuWorkflow) AddRequest ¶
func (c *ChukonuWorkflow) AddRequest(fn func(context.Context) ChukonuRequest)
func (*ChukonuWorkflow) HasNext ¶
func (c *ChukonuWorkflow) HasNext() bool
func (*ChukonuWorkflow) Next ¶
func (c *ChukonuWorkflow) Next() ChukonuRequest
func (*ChukonuWorkflow) PostProcess ¶
func (c *ChukonuWorkflow) PostProcess(req ChukonuRequest, res ChukonuResponse)
type Engine ¶
type Engine interface { RunRequest(request ChukonuRequest) (ChukonuResponse, error) ResetState() error }
type LogReplayer ¶
type LogReplayer interface {
ParseLog(filename string) RequestProvider
}
type MetricsManager ¶
type MetricsManager interface { MeasureThroughput() RecordThroughput(sec float64) GetThroughput() int SampleMetrics() StartRecording() (chan int, chan ChukonuRequest, chan ChukonuResponse, chan error) SetConsulConfig(tenantId string, cid string, consulAddress string) }
type Pool ¶
type Pool struct { }
func (Pool) Start ¶
func (p Pool) Start(engines []Engine, provider RequestProvider, metricsManager MetricsManager, config ChukonuConfig, fuse chan bool, ack chan bool)
type RequestProvider ¶
type RequestProvider interface { Provide(chan *ChukonuWorkflow) UseEngine() func(ChukonuConfig) Engine MetricsManager() MetricsManager }
Click to show internal directories.
Click to hide internal directories.