Documentation
¶
Index ¶
- func NewStatBinder(stats xstats.XStater) func(messageprocessor.MessageProcessor) messageprocessor.MessageProcessor
- func NewStatMessageProcessor() func(messageprocessor.MessageProcessor) messageprocessor.MessageProcessor
- type StatBinder
- type StatMessageProcessor
- type StatMessageProcessorComponent
- type StatMessageProcessorConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewStatBinder ¶
func NewStatBinder(stats xstats.XStater) func(messageprocessor.MessageProcessor) messageprocessor.MessageProcessor
NewStatBinder returns a function that wraps a `transport.Decorator` in a `StatTransport` `transport.Decorator`.
func NewStatMessageProcessor ¶
func NewStatMessageProcessor() func(messageprocessor.MessageProcessor) messageprocessor.MessageProcessor
NewStatMessageProcessor returns a function that wraps a `messageprocessor.MessageProcessor` in a `StatMessageProcessor` `messageprocessor.MessageProcessor`.
Types ¶
type StatBinder ¶
type StatBinder struct {
// contains filtered or unexported fields
}
StatBinder is a `MessageProcessor` decorator that injects an `xstats.XStater` into the `context.Context` of the given `context`.
The `StatBinder` can then, in turn, be decorated with `Transport` to make use of the injected `xstats.XStater` to emit key HTTP metrics on each ProcessMessage.
func (*StatBinder) ProcessMessage ¶
func (t *StatBinder) ProcessMessage(ctx context.Context, record *kinesis.Record) messageprocessor.MessageProcessorError
ProcessMessage injects an `xstats.XStater` into the context and invokes the wrapped `MessageProcessor`.
type StatMessageProcessor ¶
type StatMessageProcessor struct { ConsumedCounter string ConsumerSuccessCounter string ConsumerErrorCounter string ConsumedSize string ConsumerLag string ConsumerTimingSuccess string ConsumerTimingFailure string // contains filtered or unexported fields }
StatMessageProcessor is wrapper around MessageProcessor to capture and emit Kinesis related stats
func (StatMessageProcessor) ProcessMessage ¶
func (t StatMessageProcessor) ProcessMessage(ctx context.Context, record *kinesis.Record) messageprocessor.MessageProcessorError
ProcessMessage injects an `xstats.XStater` into the request and invokes the wrapped `MessageProcessor.ProcessMessage`.
type StatMessageProcessorComponent ¶
type StatMessageProcessorComponent struct{}
StatMessageProcessorComponent implements the settings.Component interface.
func NewComponent ¶
func NewComponent() *StatMessageProcessorComponent
NewComponent populates default values.
func (*StatMessageProcessorComponent) New ¶
func (c *StatMessageProcessorComponent) New(_ context.Context, conf *StatMessageProcessorConfig) (func(messageprocessor.MessageProcessor) messageprocessor.MessageProcessor, error)
func (*StatMessageProcessorComponent) Settings ¶
func (*StatMessageProcessorComponent) Settings() *StatMessageProcessorConfig
Settings generates a config populated with defaults.
type StatMessageProcessorConfig ¶
type StatMessageProcessorConfig struct { ConsumedCounter string `description:"Name of overall kinesis record consumption metric."` ConsumerSuccessCounter string `description:"Name of overall successful kinesis record consumption metric."` ConsumerErrorCounter string `description:"Name of overall failed kinesis record consumption metric."` ConsumedSize string `description:"Name of consumed kinesis record size metric."` ConsumerLag string `description:"Name of lag time between kinesis production and consumption metric."` ConsumerTimingSuccess string `description:"Name of time to process successful kinesis record metric."` ConsumerTimingFailure string `description:"Name of time to process failed kinesis record metric."` }
StatMessageProcessorConfig is the config for creating a StatMessageProcessor
func (*StatMessageProcessorConfig) Name ¶
func (*StatMessageProcessorConfig) Name() string
Name of the config root.