Documentation ¶
Index ¶
- type CSVCollector
- type Context
- func (r *Context) Bool(name string) bool
- func (r *Context) Duration(name string, defaultValue time.Duration) time.Duration
- func (r *Context) Int(name string, defaultValue int) int
- func (r *Context) IsSet(name string) bool
- func (r *Context) Name() string
- func (r *Context) NewBoolOption(name string, value bool)
- func (r *Context) NewDurationOption(name string, value time.Duration)
- func (r *Context) NewIntOption(name string, value int)
- func (r *Context) NewSliceOption(name string, value []string)
- func (r *Context) NewStingOption(name, value string)
- func (r *Context) PrefixMap(prefix string) map[string]string
- func (r *Context) Slice(name string) []string
- func (r *Context) String(name, defaultValue string) string
- func (r *Context) ToMap() map[string]string
- type Deployable
- type Deployment
- type ExecutionStrategy
- type InvocableOptions
- type InvocationPayload
- type Invokable
- type Job
- func (j *Job) AsParentContext() context.Context
- func (j *Job) Cancel()
- func (j *Job) Canceled() <-chan struct{}
- func (j *Job) Done(payloadID string)
- func (j *Job) Finish()
- func (j *Job) Info(text string)
- func (j *Job) Name() string
- func (j *Job) PayloadFromId(payloadID string) (InvocationPayload, error)
- func (j *Job) PrintStats()
- func (j *Job) SubmittedTask(payload InvocationPayload)
- func (j *Job) TakeQuery() time.Time
- func (j *Job) TakeSpawn() time.Time
- func (j *Job) Wait()
- func (j *Job) WithTimeout(timeout time.Duration) error
- type Measurable
- type Measurement
- func (data Measurement) InvocationID() string
- func (data Measurement) IsFailure() bool
- func (data Measurement) JobID() string
- func (data Measurement) SetInvocationID(name string)
- func (data Measurement) SetJobID(name string)
- func (data Measurement) SetRequestLatency(latency time.Duration)
- func (m Measurement) WithDefaults() Measurement
- type MockInvocation
- func (m *MockInvocation) Done()
- func (m *MockInvocation) Error() error
- func (m *MockInvocation) GetNumberOfSubmissions() int8
- func (m *MockInvocation) ID() string
- func (m *MockInvocation) IsCompleted() bool
- func (m *MockInvocation) Latancy() time.Duration
- func (m *MockInvocation) MarkAsResubmitted()
- func (m *MockInvocation) Runtime() Runtime
- func (m *MockInvocation) SetError(err error)
- func (m *MockInvocation) Submitted() int8
- func (m *MockInvocation) SubmittedAt() time.Time
- func (m *MockInvocation) Succeed() bool
- func (m *MockInvocation) WriteError(writer ResultCollector)
- type MockRuntime
- func (m *MockRuntime) InvocationPayload(c *Context, s ...string) ([]InvocationPayload, error)
- func (m *MockRuntime) MakeDeployment(c *Context, s ...string) (Deployable, error)
- func (m *MockRuntime) MakeFailure(id, cause string, start time.Time) Measurement
- func (m *MockRuntime) MakeMeasurement(m2 map[string]interface{}) Measurement
- type MockWriter
- type Monitor
- type Platform
- type ProgressMonitor
- type ResultCollector
- type Runtime
- type ScaleOptions
- type Submittable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSVCollector ¶
type CSVCollector struct {
// contains filtered or unexported fields
}
func (*CSVCollector) Add ¶
func (c *CSVCollector) Add(data Measurement)
func (*CSVCollector) Print ¶
func (c *CSVCollector) Print()
func (*CSVCollector) Write ¶
func (c *CSVCollector) Write(outputfile string) error
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewContext ¶
func (*Context) NewBoolOption ¶
func (*Context) NewDurationOption ¶
func (*Context) NewIntOption ¶
func (*Context) NewSliceOption ¶
func (*Context) NewStingOption ¶
type Deployable ¶
type Deployment ¶
type Deployment interface {
ID() string
}
type ExecutionStrategy ¶
type ExecutionStrategy interface {
Execute(*Job, Submittable, ResultCollector) error
}
type InvocableOptions ¶
type InvocableOptions interface {
Apply()
}
type InvocationPayload ¶
type InvocationPayload interface { //uniuqe task IID (can be used to assosiate returned invocations to submitted invocations) ID() string //the time this payload was send SubmittedAt() time.Time //the latancy between the sumitted time and the time Done was called Latancy() time.Duration //if this payload is processed, e.g. we know it failed, or we have a result IsCompleted() bool //any error that occured with this paylaod Error() error //sets stubmission time and counts the number or resubmissions Submitted() int8 //retuns the number of sumissions to a platfrom GetNumberOfSubmissions() int8 //sets an error SetError(err error) //the runitme used to generate this invocation Runtime() Runtime //Set completed to true and stores compleation time Done() //writer.Add(payload.Runtime().MakeFailure(payload.ID(),payload.Error().Error(),payload.SubmittedAt())) WriteError(writer ResultCollector) //is called if a task gets resubmitted (due to error or because it seamed to straggle) MarkAsResubmitted() }
type Invokable ¶
type Invokable interface { //Invoke a makeDeploymentPayload directly Invoke(Deployment, InvocationPayload, ResultCollector) error }
type Job ¶
type Job struct { Context Context // Deployment Deployment Tasks []InvocationPayload // contains filtered or unexported fields }
func NewJob ¶
func NewJob(ctx context.Context, tasks []InvocationPayload, requestsPerSeconds int, monitor ProgressMonitor) *Job
func (*Job) AsParentContext ¶
func (*Job) PayloadFromId ¶
func (j *Job) PayloadFromId(payloadID string) (InvocationPayload, error)
func (*Job) PrintStats ¶
func (j *Job) PrintStats()
func (*Job) SubmittedTask ¶
func (j *Job) SubmittedTask(payload InvocationPayload)
type Measurable ¶
type Measurable interface { //XXX: these I don't like MakeFailure(id, cause string, start time.Time) Measurement MakeMeasurement(map[string]interface{}) Measurement }
type Measurement ¶
type Measurement map[string]interface{}
func (Measurement) InvocationID ¶
func (data Measurement) InvocationID() string
func (Measurement) IsFailure ¶
func (data Measurement) IsFailure() bool
func (Measurement) JobID ¶
func (data Measurement) JobID() string
func (Measurement) SetInvocationID ¶
func (data Measurement) SetInvocationID(name string)
func (Measurement) SetJobID ¶
func (data Measurement) SetJobID(name string)
func (Measurement) SetRequestLatency ¶
func (data Measurement) SetRequestLatency(latency time.Duration)
func (Measurement) WithDefaults ¶
func (m Measurement) WithDefaults() Measurement
type MockInvocation ¶
type MockInvocation struct { IID string SUB time.Time COM time.Time DONE bool ERR error Tries int8 Delay time.Duration SuccessSelector func(invocation *MockInvocation) bool }
func (*MockInvocation) Done ¶
func (m *MockInvocation) Done()
func (*MockInvocation) Error ¶
func (m *MockInvocation) Error() error
func (*MockInvocation) GetNumberOfSubmissions ¶
func (m *MockInvocation) GetNumberOfSubmissions() int8
func (*MockInvocation) ID ¶
func (m *MockInvocation) ID() string
func (*MockInvocation) IsCompleted ¶
func (m *MockInvocation) IsCompleted() bool
func (*MockInvocation) Latancy ¶
func (m *MockInvocation) Latancy() time.Duration
func (*MockInvocation) MarkAsResubmitted ¶
func (m *MockInvocation) MarkAsResubmitted()
func (*MockInvocation) Runtime ¶
func (m *MockInvocation) Runtime() Runtime
func (*MockInvocation) SetError ¶
func (m *MockInvocation) SetError(err error)
func (*MockInvocation) Submitted ¶
func (m *MockInvocation) Submitted() int8
func (*MockInvocation) SubmittedAt ¶
func (m *MockInvocation) SubmittedAt() time.Time
func (*MockInvocation) Succeed ¶
func (m *MockInvocation) Succeed() bool
func (*MockInvocation) WriteError ¶
func (m *MockInvocation) WriteError(writer ResultCollector)
type MockRuntime ¶
type MockRuntime struct { }
func (*MockRuntime) InvocationPayload ¶
func (m *MockRuntime) InvocationPayload(c *Context, s ...string) ([]InvocationPayload, error)
func (*MockRuntime) MakeDeployment ¶
func (m *MockRuntime) MakeDeployment(c *Context, s ...string) (Deployable, error)
func (*MockRuntime) MakeFailure ¶
func (m *MockRuntime) MakeFailure(id, cause string, start time.Time) Measurement
func (*MockRuntime) MakeMeasurement ¶
func (m *MockRuntime) MakeMeasurement(m2 map[string]interface{}) Measurement
type MockWriter ¶
type MockWriter struct {
// contains filtered or unexported fields
}
func (*MockWriter) Add ¶
func (m *MockWriter) Add(measurement Measurement)
func (*MockWriter) Print ¶
func (m *MockWriter) Print()
func (*MockWriter) Write ¶
func (m *MockWriter) Write(s string) error
type Platform ¶
type Platform interface { //deploys a function Deploy(deployable Deployable) (Deployment, error) //removes a deployment Remove(deployment Deployment) error //scales up the deployment or changes current configuration Scale(Deployment, ...ScaleOptions) (Deployment, error) //all platforms are at least invocable Invokable }
type ProgressMonitor ¶
type ResultCollector ¶
type ResultCollector interface { Add(measurement Measurement) Write(string2 string) error Print() }
func NewCollector ¶
func NewCollector() ResultCollector
type Runtime ¶
type Runtime interface { //compile a set of given files to a deployment package that can be deployed to any platfrom MakeDeployment(*Context, ...string) (Deployable, error) //combine a set of input files to an invocation payload InvocationPayload(*Context, ...string) ([]InvocationPayload, error) Measurable }
type ScaleOptions ¶
type ScaleOptions func(deployment Deployment)
type Submittable ¶
type Submittable interface { Platform Invokable //Submit a job asynchronously - must be collected using Collect //TODO push <-chan map[string]interface{} into job.. Submit(*Job, InvocationPayload, chan<- map[string]interface{}, ...InvocableOptions) error Collect(*Job, <-chan map[string]interface{}, ResultCollector, ...InvocableOptions) error }
Interface for Async Submission of Workloads
Source Files ¶
Click to show internal directories.
Click to hide internal directories.