Documentation ¶
Index ¶
- type Config
- type EventReportingType
- type EventSink
- func ConstructEventSink(ctx context.Context, config *Config) (EventSink, error)
- func NewAdminEventSink(ctx context.Context, adminClient service.AdminServiceClient, config *Config) (EventSink, error)
- func NewFileSink(path string) (EventSink, error)
- func NewLogSink() (EventSink, error)
- func NewMockEventSink() EventSink
- func NewStdoutSink() (EventSink, error)
- type EventSinkType
- type FileWriter
- type LogWriter
- type MockEventSink
- type MockRecorder
- type NodeEventRecorder
- type StdWriter
- type TaskEventRecorder
- type WorkflowEventRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Type EventReportingType `json:"type" pflag:",Sets the type of EventSink to configure [log/admin/file]."` FilePath string `json:"file-path" pflag:",For file types, specify where the file should be located."` Rate int64 `json:"rate" pflag:",Max rate at which events can be recorded per second."` Capacity int `json:"capacity" pflag:",The max bucket size for event recording tokens."` }
type EventReportingType ¶
type EventReportingType = string
const ( EventSinkLog EventReportingType = "log" EventSinkFile EventReportingType = "file" EventSinkAdmin EventReportingType = "admin" )
type EventSink ¶
type EventSink interface { // Send the Event to this EventSink. The EventSink will identify the type of message through the // specified eventType and sink it appropriately based on the type. Sink(ctx context.Context, message proto.Message) error // Callers should close the EventSink when it is no longer being used as there may be long living // connections. Close() error }
EventSink determines how/where Events are emitted to. The type of EventSink the operator wants should be configurable. In Flyte, we also have local implementations so that operators can emit events without dependency on other services.
func ConstructEventSink ¶
func NewAdminEventSink ¶
func NewAdminEventSink(ctx context.Context, adminClient service.AdminServiceClient, config *Config) (EventSink, error)
Constructs a new EventSink that sends events to FlyteAdmin through gRPC
func NewFileSink ¶
TODO this will cause multiple handles to the same file if we open multiple syncs. Maybe we should remove this
func NewLogSink ¶
func NewMockEventSink ¶
func NewMockEventSink() EventSink
func NewStdoutSink ¶
type EventSinkType ¶
type EventSinkType = string
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
File Writer is just a thin wrapper around io.Writer
func (*FileWriter) Flush ¶
func (fw *FileWriter) Flush() error
type MockEventSink ¶
type MockEventSink struct { SinkCb func(ctx context.Context, message proto.Message) error CloseCb func() error }
func (*MockEventSink) Close ¶
func (t *MockEventSink) Close() error
type MockRecorder ¶
type MockRecorder struct { RecordNodeEventCb func(ctx context.Context, event *event.NodeExecutionEvent) error RecordWorkflowEventCb func(ctx context.Context, event *event.WorkflowExecutionEvent) error }
func (*MockRecorder) RecordNodeEvent ¶
func (m *MockRecorder) RecordNodeEvent(ctx context.Context, event *event.NodeExecutionEvent) error
func (*MockRecorder) RecordWorkflowEvent ¶
func (m *MockRecorder) RecordWorkflowEvent(ctx context.Context, event *event.WorkflowExecutionEvent) error
type NodeEventRecorder ¶
type NodeEventRecorder interface {
RecordNodeEvent(ctx context.Context, event *event.NodeExecutionEvent) error
}
Recorder for Node events
func NewMock ¶
func NewMock() NodeEventRecorder
func NewNodeEventRecorder ¶
func NewNodeEventRecorder(eventSink EventSink, scope promutils.Scope) NodeEventRecorder
Construct a new Node Event Recorder
type StdWriter ¶
type StdWriter struct{}
Std Writer is just the default standard if no sink type is provided
type TaskEventRecorder ¶
type TaskEventRecorder interface {
RecordTaskEvent(ctx context.Context, event *event.TaskExecutionEvent) error
}
Recorder for Task events
func NewTaskEventRecorder ¶
func NewTaskEventRecorder(eventSink EventSink, scope promutils.Scope) TaskEventRecorder
Construct a new Task Event Recorder
type WorkflowEventRecorder ¶
type WorkflowEventRecorder interface {
RecordWorkflowEvent(ctx context.Context, event *event.WorkflowExecutionEvent) error
}
Recorder for Workflow events
func NewMockWorkflowRecorder ¶
func NewMockWorkflowRecorder() WorkflowEventRecorder
func NewWorkflowEventRecorder ¶
func NewWorkflowEventRecorder(eventSink EventSink, scope promutils.Scope) WorkflowEventRecorder
Construct a new Workflow Event Recorder