Documentation ¶
Index ¶
- func Execute(spec *api.BenchmarkSpec, ctx *api.ExecutionContext)
- func LoadSpec(path string) (*api.BenchmarkSpec, error)
- func NewCommandExecutor(pipeStdout bool, pipeStderr bool) api.CommandExecutor
- func NewStreamReportHandler(spec *api.BenchmarkSpec, ctx *api.ReportContext, handleFn HandleFn) api.ReportHandler
- func NewSummary(tracesByID map[api.ID][]api.Trace) api.Summary
- func NewSummaryReportHandler(spec *api.BenchmarkSpec, ctx *api.ReportContext, ...) api.ReportHandler
- func NewTracer(bufferSize int) api.Tracer
- func SaveSpec(spec *api.BenchmarkSpec, wc io.WriteCloser) (err error)
- type CmdRecordingExecutor
- type HandleFn
- type RecordedExecutionParams
- type StreamSubscriber
- type TraceSink
- type Unsubscribe
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute(spec *api.BenchmarkSpec, ctx *api.ExecutionContext)
Execute executes a benchmark and returns an object that provides access to collected stats.
func LoadSpec ¶
func LoadSpec(path string) (*api.BenchmarkSpec, error)
LoadSpec loads benchmark specs from the specified file.
func NewCommandExecutor ¶
func NewCommandExecutor(pipeStdout bool, pipeStderr bool) api.CommandExecutor
NewCommandExecutor creates a new command executor.
func NewStreamReportHandler ¶ added in v1.1.0
func NewStreamReportHandler(spec *api.BenchmarkSpec, ctx *api.ReportContext, handleFn HandleFn) api.ReportHandler
NewStreamReportHandler create stream report subscriber. Stream report handlers are designed to handle events in real time.
func NewSummary ¶
NewSummary create a new TracerSummary with the specified data.
func NewSummaryReportHandler ¶ added in v1.1.0
func NewSummaryReportHandler(spec *api.BenchmarkSpec, ctx *api.ReportContext, writeReportFn api.WriteSummaryReportFn) api.ReportHandler
NewSummaryReportHandler create summary report subscriber Summary report handlers typically need to accumulate all the data in order to generate a report.
func SaveSpec ¶ added in v1.3.0
func SaveSpec(spec *api.BenchmarkSpec, wc io.WriteCloser) (err error)
Types ¶
type CmdRecordingExecutor ¶
type CmdRecordingExecutor struct {
RecordedCommandSeq []*RecordedExecutionParams
}
CmdRecordingExecutor ...
func (*CmdRecordingExecutor) Execute ¶
func (ce *CmdRecordingExecutor) Execute( cmdSpec *api.CommandSpec, defaultWorkingDir string, env map[string]string, ) (exitError error)
Execute records execution parameters and stores them in order
type RecordedExecutionParams ¶
type RecordedExecutionParams struct { Spec *api.CommandSpec DefaultWorkingDir string Env map[string]string }
RecordedExecutionParams ...
type StreamSubscriber ¶ added in v1.1.0
type StreamSubscriber struct {
// contains filtered or unexported fields
}
StreamSubscriber FIXME
func NewStreamSubscriber ¶ added in v1.1.0
func NewStreamSubscriber(stream api.TraceStream, handleFn HandleFn) *StreamSubscriber
NewStreamSubscriber returns a new subscriber for the specified TraceStream. Does not subscribe immediately.
func (*StreamSubscriber) Subscribe ¶ added in v1.1.0
func (s *StreamSubscriber) Subscribe() Unsubscribe
Subscribe subscribes to the TraceStream and starts handling events. Returns an Unsubscribe handler that drains the underlaying channel and stops consuming events. This method can only be called once before Unsubscribe is called.
type TraceSink ¶ added in v1.1.0
type TraceSink struct {
// contains filtered or unexported fields
}
TraceSink is a Trace accumulator capable of subscribing to a TraceStream and provide access to accumulated events
func NewTraceSink ¶ added in v1.1.0
func NewTraceSink(stream api.TraceStream) *TraceSink
NewTraceSink creates a new TraceSink for the specified stream.
func (*TraceSink) Subscribe ¶ added in v1.1.0
func (s *TraceSink) Subscribe() Unsubscribe
Subscribe subscribes to the trace events stream and returns an unsubscribe handler. Following that call, events start to accumulate.
type Unsubscribe ¶ added in v1.1.0
type Unsubscribe = func()
Unsubscribe drains a TraceStream from buffered events and unsubscribes from it.