Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // MeasureConsume measures aggregation results into the pubsub queue. MeasureConsume = stats.Int64("kostanza_aggregator/measures/consume", "Consumption operations", stats.UnitDimensionless) // TagConsumeStatus indicates the success or failure of a consumption TagConsumeStatus, _ = tag.NewKey("status") )
Functions ¶
Types ¶
type Aggregator ¶
Aggregator coalesces and persists coster.CostData from kostanza.
type BigQueryAggregator ¶
type BigQueryAggregator struct {
// contains filtered or unexported fields
}
BigQueryAggregator coalesces and persists coster.CosData data to BigQuery.
func NewBigQueryAggregator ¶
func NewBigQueryAggregator(ctx context.Context, project string, dataset string, table string, mapper *coster.Mapper) (*BigQueryAggregator, error)
NewBigQueryAggregator creates a new Aggregator that publishes consumed pubsub events to the named BigQuery dataset and table. It will attempt to provision the table using a schema inferred from the current version of the application if the table does not yet exist.
type Consumer ¶
Consumer consumes messages as long as the provided context is not canceled, or its deadline exceeded.
type CostRow ¶
CostRow augments CostData with BigQuery specific interfaces for import purposes via the bigquery.Uploader.
type PubsubConsumer ¶
type PubsubConsumer struct {
// contains filtered or unexported fields
}
PubsubConsumer consumers messages from pubsub and forwards them to the provided aggregator.
func NewPubsubConsumer ¶
func NewPubsubConsumer(ctx context.Context, prometheusExporter *prometheus.Exporter, listenAddr string, project string, topic string, subscription string, aggregator Aggregator) (*PubsubConsumer, error)
NewPubsubConsumer consumes messages from pubsub and invokes the provider aggregator with the message contents.