Documentation ¶
Index ¶
- Constants
- Variables
- func CompareRawdataWithInfluxResults(readRawdata *Common.ReadRawdata, results []InfluxDBClient.Result) error
- func InfluxResultToReadRawdata(results []InfluxDBClient.Result, query *Common.Query) *Common.ReadRawdata
- func ReadRawdata(config *Config, queries []*Common.Query) ([]*Common.ReadRawdata, error)
- func WriteRawdata(config *Config, writeRawdata []*Common.WriteRawdata) error
- type Config
- type Database
- type InfluxDBEntity
- type InfluxDBRepository
- func (influxDBRepository *InfluxDBRepository) CreateDatabase(db string) error
- func (influxDBRepository *InfluxDBRepository) ModifyDefaultRetentionPolicy(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 InfluxStatement
- type Measurement
- type Order
- type QueryCondition
- type Statement
- type StatementNew
- func (s *StatementNew) AppendLimitClauseFromQueryCondition()
- func (s *StatementNew) AppendOrderClauseFromQueryCondition()
- func (s *StatementNew) AppendTimeCondition(operator string, value int64)
- func (s *StatementNew) AppendTimeConditionFromQueryCondition()
- func (s *StatementNew) AppendWhereCondition(key string, operator string, value string)
- func (s *StatementNew) AppendWhereConditionDirect(condition string)
- func (s StatementNew) BuildQueryCmd() string
Constants ¶
View Source
const ( // Time is InfluxDB time tag Time string = "time" // EndTime is InfluxDB time tag EndTime string = "end_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" // Planning is planning database Planning Database = "alameda_planning" // 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 ¶
func CompareRawdataWithInfluxResults ¶ added in v0.3.31
func CompareRawdataWithInfluxResults(readRawdata *Common.ReadRawdata, results []InfluxDBClient.Result) error
func InfluxResultToReadRawdata ¶ added in v0.3.31
func InfluxResultToReadRawdata(results []InfluxDBClient.Result, query *Common.Query) *Common.ReadRawdata
func ReadRawdata ¶ added in v0.3.31
func WriteRawdata ¶ added in v0.3.31
func WriteRawdata(config *Config, writeRawdata []*Common.WriteRawdata) error
Types ¶
type Config ¶
type Config struct { Address string `mapstructure:"address"` Username string `mapstructure:"username"` Password string `mapstructure:"password"` RetentionDuration string `mapstructure:"retentionDuration"` RetentionShardDuration string `mapstructure:"retentionShardDuration"` }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
type InfluxDBEntity ¶
type InfluxDBRepository ¶
type InfluxDBRepository struct { Address string Username string Password string RetentionDuration string RetentionShardDuration string }
InfluxDBRepository interacts with database
func (*InfluxDBRepository) CreateDatabase ¶
func (influxDBRepository *InfluxDBRepository) CreateDatabase(db string) error
CreateDatabase creates database
func (*InfluxDBRepository) ModifyDefaultRetentionPolicy ¶ added in v0.3.8
func (influxDBRepository *InfluxDBRepository) ModifyDefaultRetentionPolicy(db string) error
Modify default retention policy
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
func ReadRawdataToInfluxDBRow ¶ added in v0.3.31
func ReadRawdataToInfluxDBRow(readRawdata *Common.ReadRawdata) []*InfluxDBRow
type InfluxStatement ¶ added in v0.3.31
type InfluxStatement struct { QueryCondition *QueryCondition Database Database Measurement Measurement SelectedFields []string GroupByTags []string WhereClause string OrderClause string LimitClause string }
func NewInfluxStatement ¶ added in v0.3.31
func NewInfluxStatement(query *Common.Query) *InfluxStatement
func (*InfluxStatement) AppendTimeConditionIntoWhereClause ¶ added in v0.3.31
func (s *InfluxStatement) AppendTimeConditionIntoWhereClause()
func (InfluxStatement) BuildQueryCmd ¶ added in v0.3.31
func (s InfluxStatement) BuildQueryCmd() string
func (*InfluxStatement) SetLimitClauseFromQueryCondition ¶ added in v0.3.31
func (s *InfluxStatement) SetLimitClauseFromQueryCondition()
func (*InfluxStatement) SetOrderClauseFromQueryCondition ¶ added in v0.3.31
func (s *InfluxStatement) SetOrderClauseFromQueryCondition()
type Measurement ¶
type Measurement string
type QueryCondition ¶ added in v0.3.0
type QueryCondition struct { StartTime *time.Time EndTime *time.Time StepTime *time.Duration TimestampOrder Order Limit int }
QueryCondition Others query condition
type Statement ¶ added in v0.3.0
type Statement struct { Measurement Measurement SelectedFields []string GroupByTags []string WhereClause string OrderClause string LimitClause string }
func (*Statement) AppendTimeConditionIntoWhereClause ¶ added in v0.3.0
func (s *Statement) AppendTimeConditionIntoWhereClause(queryCondition QueryCondition)
func (Statement) BuildQueryCmd ¶ added in v0.3.0
func (*Statement) SetLimitClauseFromQueryCondition ¶ added in v0.3.0
func (s *Statement) SetLimitClauseFromQueryCondition(queryCondition QueryCondition)
func (*Statement) SetOrderClauseFromQueryCondition ¶ added in v0.3.0
func (s *Statement) SetOrderClauseFromQueryCondition(queryCondition QueryCondition)
type StatementNew ¶ added in v0.3.27
type StatementNew struct { Measurement Measurement SelectedFields []string GroupByTags []string WhereClause string OrderClause string LimitClause string StepClause string QueryCondition *datahub_v1alpha1.QueryCondition }
func (*StatementNew) AppendLimitClauseFromQueryCondition ¶ added in v0.3.27
func (s *StatementNew) AppendLimitClauseFromQueryCondition()
func (*StatementNew) AppendOrderClauseFromQueryCondition ¶ added in v0.3.27
func (s *StatementNew) AppendOrderClauseFromQueryCondition()
func (*StatementNew) AppendTimeCondition ¶ added in v0.3.27
func (s *StatementNew) AppendTimeCondition(operator string, value int64)
func (*StatementNew) AppendTimeConditionFromQueryCondition ¶ added in v0.3.27
func (s *StatementNew) AppendTimeConditionFromQueryCondition()
func (*StatementNew) AppendWhereCondition ¶ added in v0.3.27
func (s *StatementNew) AppendWhereCondition(key string, operator string, value string)
func (*StatementNew) AppendWhereConditionDirect ¶ added in v0.3.27
func (s *StatementNew) AppendWhereConditionDirect(condition string)
func (StatementNew) BuildQueryCmd ¶ added in v0.3.27
func (s StatementNew) BuildQueryCmd() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.