Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type Database
- type InfluxDBEntity
- type InfluxDBRepository
- func (influxDBRepository *InfluxDBRepository) CreateDatabase(db string) error
- func (influxDBRepository *InfluxDBRepository) QueryDB(cmd, database string) (res []client.Result, err error)
- func (influxDBRepository *InfluxDBRepository) WritePoints(points []*client.Point, bpCfg client.BatchPointsConfig) error
- type InfluxDBRow
- type Measurement
Constants ¶
View Source
const ( // Time is InfluxDB time tag Time string = "time" // ClusterStatus is cluster_status database ClusterStatus Database = "alameda_cluster_status" // Prediction is prediction database Prediction Database = "alameda_prediction" // Recommendation is recommendation database Recommendation Database = "alameda_recommendation" // Score is score database Score Database = "alameda_score" )
Variables ¶
View Source
var ( // ZeroTime is used as a constant of timestamp ZeroTime time.Time = time.Unix(0, 0) )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Address string `mapstructure:"address"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type InfluxDBEntity ¶
type InfluxDBRepository ¶
InfluxDBRepository interacts with database
func (*InfluxDBRepository) CreateDatabase ¶
func (influxDBRepository *InfluxDBRepository) CreateDatabase(db string) error
CreateDatabase creates database
func (*InfluxDBRepository) QueryDB ¶
func (influxDBRepository *InfluxDBRepository) QueryDB(cmd, database string) (res []client.Result, err error)
QueryDB queries database
func (*InfluxDBRepository) WritePoints ¶
func (influxDBRepository *InfluxDBRepository) WritePoints(points []*client.Point, bpCfg client.BatchPointsConfig) error
WritePoints writes points to database
type InfluxDBRow ¶
type InfluxDBRow struct { Name string Tags map[string]string Data []map[string]string Partial bool }
func NormalizeResult ¶
func NormalizeResult(rows []*InfluxDBRow) []*InfluxDBRow
func PackMap ¶
func PackMap(results []client.Result) []*InfluxDBRow
type Measurement ¶
type Measurement string
Click to show internal directories.
Click to hide internal directories.