Documentation ¶
Index ¶
- func NewSampleIngestor(shards int, samples PromIterator, batchSize int, sampleRate int) *sampleIngestor
- func NewSeriesGenerator(numMetrics, numSeriesPerMetric, labels int) (*seriesGen, error)
- type BlockSample
- type IngestFunc
- type MockBatch
- type MockBatchResults
- type MockPgxConn
- func (MockPgxConn) Acquire(ctx context.Context) (*pgxpool.Conn, error)
- func (MockPgxConn) BeginTx(ctx context.Context) (pgx.Tx, error)
- func (MockPgxConn) Close()
- func (MockPgxConn) CopyFrom(ctx context.Context, tx pgx.Tx, tableName pgx.Identifier, columnNames []string, ...) (int64, error)
- func (MockPgxConn) CopyFromRows(rows [][]interface{}) pgx.CopyFromSource
- func (MockPgxConn) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
- func (MockPgxConn) NewBatch() pgxconn.PgxBatch
- func (MockPgxConn) Query(ctx context.Context, sql string, args ...interface{}) (pgxconn.PgxRows, error)
- func (MockPgxConn) QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
- func (MockPgxConn) SendBatch(ctx context.Context, b pgxconn.PgxBatch) (pgx.BatchResults, error)
- type MockRow
- type PromIterator
- type PromLoader
- type TimeSeries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSampleIngestor ¶
func NewSampleIngestor(shards int, samples PromIterator, batchSize int, sampleRate int) *sampleIngestor
NewSampleIngestor creates sampleIngestor responsible for splitting samples into shards and sending them down the ingestion path zero sampleRate means no limits
func NewSeriesGenerator ¶
NewSeriesGenerator generates distinct timeseries equal to numMetrics * numSeriesPerMetric, such that each timeseries has `labels` count of labels. The label keys are common across the series, but their values are random, thereby creating a new series.
Types ¶
type BlockSample ¶
type BlockSample struct {
// contains filtered or unexported fields
}
Sample loaded from Prometheus block
type IngestFunc ¶
type MockBatchResults ¶
type MockBatchResults struct{}
func (MockBatchResults) Close ¶
func (MockBatchResults) Close() error
func (MockBatchResults) Exec ¶
func (MockBatchResults) Exec() (pgconn.CommandTag, error)
func (MockBatchResults) Query ¶
func (MockBatchResults) Query() (pgx.Rows, error)
func (MockBatchResults) QueryRow ¶
func (MockBatchResults) QueryRow() pgx.Row
type MockPgxConn ¶
type MockPgxConn struct{}
func (MockPgxConn) Close ¶
func (MockPgxConn) Close()
func (MockPgxConn) CopyFromRows ¶
func (MockPgxConn) CopyFromRows(rows [][]interface{}) pgx.CopyFromSource
func (MockPgxConn) Exec ¶
func (MockPgxConn) Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
func (MockPgxConn) NewBatch ¶
func (MockPgxConn) NewBatch() pgxconn.PgxBatch
type PromIterator ¶
type PromIterator interface { Next() bool Get() TimeSeries }
PromIterator allows us to iterate over Prometheus data
type PromLoader ¶
type PromLoader interface { Iterator() PromIterator Close() error }
PromLoader is responsible for loading Prometheus data files and providing iterator over Prometheus data
func NewPromLoader ¶
func NewPromLoader(dataDir string, inMemory bool) (PromLoader, error)
PromLoader can preload the whole dataset in memory which can be useful to get accurate memory allocations when benchmarking. However it does mean that bench test needs more memory to run so make sure that test dataset can fit into memory
type TimeSeries ¶
type TimeSeries struct { Val prompb.TimeSeries // contains filtered or unexported fields }