Documentation
¶
Index ¶
- func GetExperimentResponseChannel(ctx context.Context) (chan *Response, error)
- func NewExperimentRunner(name string, cfg map[string]interface{}, livenessPeriodSeconds int) (runner.ExperimentRunner, error)
- func NewMetricsInterceptor() runner.Interceptor
- func WithExperimentResponseChannel(ctx context.Context, ch chan *Response) context.Context
- type MetricsInterceptor
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetExperimentResponseChannel ¶
GetExperimentResponseChannel returns a pointer to a channel of type *Response, which holds the experiment treatment / error, from the input context
func NewExperimentRunner ¶
func NewExperimentRunner( name string, cfg map[string]interface{}, livenessPeriodSeconds int, ) (runner.ExperimentRunner, error)
NewExperimentRunner returns an instance of the Planner, based on the input engine name
func NewMetricsInterceptor ¶
func NewMetricsInterceptor() runner.Interceptor
NewMetricsInterceptor is a creator for a MetricsInterceptor
Types ¶
type MetricsInterceptor ¶
type MetricsInterceptor struct{}
MetricsInterceptor is the structural interceptor used for capturing metrics from experiment runs
func (*MetricsInterceptor) AfterCompletion ¶
func (i *MetricsInterceptor) AfterCompletion( ctx context.Context, err error, )
AfterCompletion logs the time taken for the component to process the request, to the metrics collector
func (*MetricsInterceptor) BeforeDispatch ¶
func (i *MetricsInterceptor) BeforeDispatch( ctx context.Context, ) context.Context
BeforeDispatch associates the start time to the context
type Response ¶
type Response struct {
// Success response from the experiment engine, unmodified
Configuration json.RawMessage `json:"configuration,omitempty"`
// Experiment and treatment name are omitted for now as client does not depend on this.
ExperimentName string `json:"-"`
TreatmentName string `json:"-"`
// Error message
Error string `json:"error,omitempty"`
}
Response holds the experiment configuration / error response, also satisfies the missionctl/http Response interface
func NewResponse ¶
NewResponse is a helper function to create an object of type Response that holds the experiment treatment / appropriate error information