Documentation ¶
Index ¶
- type Client
- type ClientMetrics
- type EventHandler
- type Handler
- func (h *Handler) AddEvent(pe *pbpod.PodEvent) error
- func (h *Handler) GetEvents() ([]*pbevent.Event, error)
- func (h *Handler) InitStream(ctx context.Context, req *pbeventstreamsvc.InitStreamRequest) (*pbeventstreamsvc.InitStreamResponse, error)
- func (h *Handler) WaitForEvents(ctx context.Context, req *pbeventstreamsvc.WaitForEventsRequest) (*pbeventstreamsvc.WaitForEventsResponse, error)
- type HandlerMetrics
- type PurgedEventsProcessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the event stream client
func NewEventStreamClient ¶
func NewEventStreamClient( d *yarpc.Dispatcher, clientName string, server string, taskUpdateHandler EventHandler, parentScope tally.Scope, ) *Client
NewEventStreamClient creates a client that consumes from remote event stream handler
type ClientMetrics ¶
type ClientMetrics struct { EventsConsumed tally.Counter StreamIDChange tally.Counter PurgeOffset tally.Gauge InitStreamAPI tally.Counter InitStreamSuccess tally.Counter InitStreamFail tally.Counter WaitForEventsAPI tally.Counter WaitForEventsSuccess tally.Counter WaitForEventsFailed tally.Counter }
ClientMetrics is the metrics for event stream client
func NewClientMetrics ¶
func NewClientMetrics(scope tally.Scope) *ClientMetrics
NewClientMetrics creates a new ClientMetrics
type EventHandler ¶
type EventHandler interface { // The event notification callback OnV1Event(event *pbevent.Event) // The events notification callback OnV1Events(events []*pbevent.Event) // Returns the event progress the handler has processed. The value // will be used by the client to determine the purgeOffset GetEventProgress() uint64 }
EventHandler is the interface for handling task update events
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler holds a circular buffer and serves request to pull data. This component is used in hostmgr and resmgr.
func NewEventStreamHandler ¶
func NewEventStreamHandler( bufferSize int, expectedClients []string, purgedEventsProcessor PurgedEventsProcessor, parentScope tally.Scope, ) *Handler
NewEventStreamHandler creates an EventStreamHandler.
func (*Handler) AddEvent ¶
AddEvent adds a task Event or mesos status update into the inner circular buffer.
func (*Handler) GetEvents ¶
GetEvents returns all the events pending in circular buffer This method is primarily for debugging purpose
func (*Handler) InitStream ¶
func (h *Handler) InitStream( ctx context.Context, req *pbeventstreamsvc.InitStreamRequest, ) (*pbeventstreamsvc.InitStreamResponse, error)
InitStream handles the initstream request.
func (*Handler) WaitForEvents ¶
func (h *Handler) WaitForEvents( ctx context.Context, req *pbeventstreamsvc.WaitForEventsRequest, ) (*pbeventstreamsvc.WaitForEventsResponse, error)
WaitForEvents handles the WaitForEvents request.
type HandlerMetrics ¶
type HandlerMetrics struct { Head tally.Gauge Tail tally.Gauge Size tally.Gauge Capacity tally.Gauge UnexpectedClientError tally.Counter PurgeEventError tally.Counter InvalidStreamIDError tally.Counter AddEventAPI tally.Counter AddEventSuccess tally.Counter AddEventFail tally.Counter InitStreamAPI tally.Counter InitStreamSuccess tally.Counter InitStreamFail tally.Counter WaitForEventsAPI tally.Counter WaitForEventsSuccess tally.Counter WaitForEventsFailed tally.Counter }
HandlerMetrics is the metrics for event stream handler
func NewHandlerMetrics ¶
func NewHandlerMetrics(scope tally.Scope) *HandlerMetrics
NewHandlerMetrics creates a HandlerMetrics
type PurgedEventsProcessor ¶
type PurgedEventsProcessor interface {
EventPurged(events []*cirbuf.CircularBufferItem)
}
PurgedEventsProcessor is the interface to handle the purged data.