Documentation
¶
Index ¶
Constants ¶
const ( BATBQ = "batbq" BATCHER = "batcher" )
metrics prefix and label name
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatcherOption ¶ added in v0.0.15
type BatcherOption interface {
// contains filtered or unexported methods
}
BatcherOption configures the batcher.
type Config ¶ added in v0.0.16
type Config config.BatcherConfig
Config wraps a config.BatcherConfig to be used as BatcherOption.
type InsertBatcher ¶
type InsertBatcher struct {
// contains filtered or unexported fields
}
InsertBatcher implements automatic batching with a batch capacity and flushInterval.
func NewInsertBatcher ¶
func NewInsertBatcher(id string, opt ...BatcherOption) *InsertBatcher
NewInsertBatcher returns an InsertBatcher.
func (*InsertBatcher) Metrics ¶ added in v0.0.5
func (ins *InsertBatcher) Metrics() *Metrics
Metrics returns the metrics.
type LogMessage ¶
type LogMessage struct {
bigquery.StructSaver
}
LogMessage implements the `Message` interface. A LogMessage ignores the `Ack()` and logs a given error from `Nack(err error)`. Use it for testing and for naive data pipelines that do not require acknowledging messages.
func (*LogMessage) Data ¶
func (m *LogMessage) Data() bigquery.ValueSaver
Data returns the embedded StructSaver.
type Message ¶
type Message interface { Data() bigquery.ValueSaver // Data returns a ValueSaver for the bigquery.Inserter Ack() // Ack confirms successful processing of the message at the sender. Nack(err error) // Nack reports unsuccessful processing and errors to the sender. }
Message defines an (n)ackable message that contains the data for BigQuery.
type Metrics ¶ added in v0.0.5
type Metrics struct { // State NumWorkers *prometheus.GaugeVec PendingMessages *prometheus.GaugeVec // Results ReceivedMessages *prometheus.CounterVec ProcessedMessages *prometheus.CounterVec ProcessedBatches *prometheus.CounterVec InsertErrors *prometheus.CounterVec // Latencies InsertLatency *prometheus.HistogramVec AckLatency *prometheus.HistogramVec }
Metrics stores Batcher Metrics.
func NewMetrics ¶ added in v0.0.16
NewMetrics create returns a new Metrics object.
func (*Metrics) Register ¶ added in v0.0.9
func (m *Metrics) Register(reg prometheus.Registerer)
Register registers all metrics.