Documentation ¶
Index ¶
- type BadStatusError
- type EmitFunc
- type Emitter
- type Event
- func NewBootEvent(ts int64, version string, endpoints map[string]string) Event
- func NewErrorEvent(ts int64, path string, record interface{}, message string) Event
- func NewExitEvent(ts int64, version string, endpoints map[string]string) Event
- func NewMetricsEvent(ts int64, path string, records int) Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BadStatusError ¶
type BadStatusError struct {
// contains filtered or unexported fields
}
BadStatusError wraps the underlying error when the provided is not parsable time.ParseDuration
func (BadStatusError) Error ¶
func (e BadStatusError) Error() string
type EmitFunc ¶
EmitFunc is a function that takes an Event as input and emits it
func HTTPPostEmitter ¶
HTTPPostEmitter listens on the event channel and posts the events to an http server Events are serialized into json, and sent via a POST request to the given Uri http errors are logged as warnings to the console, and won't stop the Emitter
func JSONLogEmitter ¶
func JSONLogEmitter() EmitFunc
JSONLogEmitter constructs a LogEmitter to use with a transporter pipeline. A JsonLogEmitter listens on the event channel and uses go's fmt package to emit the event, eg. {"ts":1436889121,"name":"metrics","path":"source-development.jobs/dest-x.jobs","records":121} {"ts":1436889121,"name":"exit","version":"0.0.4","endpoints":{"dest-x.jobs":"mongo","source-development.jobs":"mongo"}}
func LogEmitter ¶
func LogEmitter() EmitFunc
LogEmitter constructs a LogEmitter to use with a transporter pipeline. A LogEmitter listens on the event channel and uses go's log package to emit the event, eg.
2014/11/28 16:56:58 boot map[source:mongo out:mongo] 2014/11/28 16:56:58 metrics source recordsIn: 0, recordsOut: 203 2014/11/28 16:56:58 exit 2014/11/28 16:56:58 metrics source/out recordsIn: 203, recordsOut: 0
func NoopEmitter ¶
func NoopEmitter() EmitFunc
NoopEmitter consumes the events from the listening channel and does nothing with them this is useful for cli utilities that dump output to stdout in any case, and don't want to clutter the program's output with metrics
type Emitter ¶
type Emitter interface { Start() Stop() }
Emitter types are used by the transporter pipeline to consume events from a pipeline's event channel and process them. Start() will start the emitter and being consuming events Stop() stops the event loop and releases any resources. Stop is expected to shut down the process cleanly, the pipeline process will block until Stop() returns
func NewEmitter ¶
NewEmitter creates a new emitter that will listen on the listen channel and use the emit EmitFunc to process events
type Event ¶
Event is an interface that describes data which is produced periodically by the running transporter.
Events come in multiple kinds. BaseEvents are emitted when the transporter starts and stops, metricsEvents are emitted by each pipe and include a measure of how many messages have been processed
func NewBootEvent ¶
NewBootEvent (surprisingly) creates a new BaseEvent
func NewErrorEvent ¶
NewErrorEvent are events sent to indicate a problem processing on one of the nodes
func NewExitEvent ¶
NewExitEvent (surprisingly) creates a new BaseEvent