Documentation ¶
Index ¶
- Constants
- func MustBegin(db *sql.DB) *sql.Tx
- func MustConnect(dbType, connStr string) *sql.DB
- func MustExec(db *sql.DB, query string, args ...interface{}) sql.Result
- func MustQuery(db *sql.DB, query string, args ...interface{}) *sql.Rows
- func NewBenchmark(dbName string, opts *LoadingOptions, dataSourceConfig *source.DataSourceConfig) (targets.Benchmark, error)
- func NewTarget() targets.ImplementedTarget
- type LoadingOptions
- type Serializer
Constants ¶
View Source
const ( TimeValueIdx = "TIME-VALUE" ValueTimeIdx = "VALUE-TIME" )
Variables ¶
This section is empty.
Functions ¶
func MustConnect ¶
MustConnect connects or exits on errors
func NewBenchmark ¶
func NewBenchmark(dbName string, opts *LoadingOptions, dataSourceConfig *source.DataSourceConfig) (targets.Benchmark, error)
func NewTarget ¶
func NewTarget() targets.ImplementedTarget
Types ¶
type LoadingOptions ¶
type LoadingOptions struct { PostgresConnect string `yaml:"postgres" mapstructure:"postgres"` Host string `yaml:"host"` User string Pass string Port string ConnDB string `yaml:"admin-db-name" mapstructure:"admin-db-name"` UseHypertable bool `yaml:"use-hypertable" mapstructure:"use-hypertable"` LogBatches bool `yaml:"log-batches" mapstructure:"log-batches"` UseJSON bool `yaml:"use-jsonb-tags" mapstructure:"use-jsonb-tags"` InTableTag bool `yaml:"in-table-partition-tag" mapstructure:"in-table-partition-tag"` NumberPartitions int `yaml:"partitions" mapstructure:"partitions"` ChunkTime time.Duration `yaml:"chunk-time" mapstructure:"chunk-time"` TimeIndex bool `yaml:"time-index" mapstructure:"time-index"` TimePartitionIndex bool `yaml:"time-partition-index" mapstructure:"time-partition-index"` PartitionIndex bool `yaml:"partition-index" mapstructure:"partition-index"` FieldIndex string `yaml:"field-index" mapstructure:"field-index"` FieldIndexCount int `yaml:"field-index-count" mapstructure:"field-index-count"` ProfileFile string `yaml:"write-profile" mapstructure:"write-profile"` ReplicationStatsFile string `yaml:"write-replication-stats" mapstructure:"write-replication-stats"` CreateMetricsTable bool `yaml:"create-metrics-table" mapstructure:"create-metrics-table"` ForceTextFormat bool `yaml:"force-text-format" mapstructure:"force-text-format"` TagColumnTypes []string `yaml:",omitempty" mapstructure:",omitempty"` }
Loading option vars:
func (*LoadingOptions) GetConnectString ¶
func (o *LoadingOptions) GetConnectString(dbName string) string
type Serializer ¶
type Serializer struct{}
Serializer writes a Point in a serialized form for TimescaleDB
func (*Serializer) Serialize ¶
Serialize writes Point p to the given Writer w, so it can be loaded by the TimescaleDB loader. The format is CSV with two lines per Point, with the first row being the tags and the second row being the field values.
e.g., tags,<tag1>,<tag2>,<tag3>,... <measurement>,<timestamp>,<field1>,<field2>,<field3>,...
Click to show internal directories.
Click to hide internal directories.