Documentation ¶
Index ¶
- Variables
- func AutoProvCountToPt(apCount *edgeproto.AutoProvCount, dmeid string, ts time.Time) (*client.Point, error)
- func CreateContinuousQuery(origin *InfluxQ, dest *InfluxQ, cq *ContinuousQuerySettings) error
- func CreateInfluxContinuousQueryName(measurement string, interval time.Duration) string
- func CreateInfluxFullyQualifiedMeasurementName(dbName string, measurement string, interval time.Duration, ...) string
- func DropContinuousQuery(origin *InfluxQ, dest *InfluxQ, measurement string, interval time.Duration, ...) error
- func GetRetentionPolicyName(dbName string, retention time.Duration, rpType RetentionPolicyType) string
- func ParseAutoProvCount(cols []string, values []interface{}) (*edgeproto.AutoProvCount, string, time.Time, error)
- type ContinuousQuerySettings
- type InfluxQ
- func (q *InfluxQ) AddMetric(metrics ...*edgeproto.Metric)
- func (q *InfluxQ) CreateRetentionPolicy(retentionTime time.Duration, rpType RetentionPolicyType) error
- func (q *InfluxQ) DoPush()
- func (q *InfluxQ) DropRetentionPolicy(rpName string) error
- func (q *InfluxQ) InitRetentionPolicy(dur time.Duration)
- func (q *InfluxQ) PushAutoProvCounts(ctx context.Context, msg *edgeproto.AutoProvCounts) error
- func (q *InfluxQ) QueryDB(cmd string) ([]client.Result, error)
- func (q *InfluxQ) RecvMetric(ctx context.Context, metric *edgeproto.Metric)
- func (q *InfluxQ) RunPush()
- func (q *InfluxQ) Start(addr string) error
- func (q *InfluxQ) Stop()
- func (q *InfluxQ) WaitConnected() bool
- func (q *InfluxQ) WaitCreated() error
- type RetentionPolicyType
Constants ¶
This section is empty.
Variables ¶
View Source
var ContinuousQueryTemplate = "CREATE CONTINUOUS QUERY \"%s\" ON \"%s\" " +
"BEGIN SELECT %s " +
"INTO %s FROM \"%s\" " +
"GROUP BY time(%s),* END"
Parameters: continuous query name, destinationDbName, appended list of op("field"), newmeasurementname, originmeasurement, time interval
View Source
var CreateRetentionPolicyTemplate = "%s RETENTION POLICY %q ON %q duration %s replication 1 shard duration %s"
View Source
var DeviceInfoAggregationFunctions = map[string]string{
"numsessions": "sum(\"numsessions\")",
}
Aggregation functions for EdgeEvents device info stats continuous queries
View Source
var DropContinuousQueryTemplate = "DROP CONTINUOUS QUERY \"%s\" ON \"%s\""
Parameters: continuous query name and DbName
View Source
var DropRetentionPolicyTemplate = "DROP RETENTION POLICY %q ON %q"
Parameters: retention policy name and DbName
View Source
var InfluxQPrecision = "us"
View Source
var InfluxQPushCountMax = 5000
View Source
var InfluxQPushCountTrigger = 50
View Source
var InfluxQPushInterval time.Duration = time.Second
View Source
var InfluxQReconnectDelay time.Duration = 10 * time.Second
View Source
var LatencyAggregationFunctions = map[string]string{
"0s": "sum(\"0s\")",
"5ms": "sum(\"5ms\")",
"10ms": "sum(\"10ms\")",
"25ms": "sum(\"25ms\")",
"50ms": "sum(\"50ms\")",
"100ms": "sum(\"100ms\")",
"min": "min(\"min\")",
"max": "max(\"max\")",
"total": "sum(\"total\")",
"avg": "sum(\"total\") / sum(\"numsamples\")",
"numsamples": "sum(\"numsamples\")",
}
Aggregation functions for EdgeEvents latency stats continuous queries
Functions ¶
func AutoProvCountToPt ¶
func CreateContinuousQuery ¶
func CreateContinuousQuery(origin *InfluxQ, dest *InfluxQ, cq *ContinuousQuerySettings) error
func DropContinuousQuery ¶
func DropContinuousQuery(origin *InfluxQ, dest *InfluxQ, measurement string, interval time.Duration, retention time.Duration) error
Drop ContinuousQuery
func GetRetentionPolicyName ¶
func GetRetentionPolicyName(dbName string, retention time.Duration, rpType RetentionPolicyType) string
func ParseAutoProvCount ¶
Types ¶
type ContinuousQuerySettings ¶
type ContinuousQuerySettings struct { Measurement string AggregationFunctions map[string]string // maps new field name to an aggregation function CollectionInterval time.Duration RetentionPolicyTime time.Duration }
Struct with information used to create Continuous Query
func CreateDeviceInfoContinuousQuerySettings ¶
func CreateDeviceInfoContinuousQuerySettings(collectionInterval time.Duration, retention time.Duration) *ContinuousQuerySettings
func CreateLatencyContinuousQuerySettings ¶
func CreateLatencyContinuousQuerySettings(collectionInterval time.Duration, retention time.Duration) *ContinuousQuerySettings
type InfluxQ ¶
type InfluxQ struct { ErrBatch uint64 ErrPoint uint64 Qfull uint64 QWrites uint64 DatWrites uint64 // contains filtered or unexported fields }
func NewInfluxQ ¶
func (*InfluxQ) CreateRetentionPolicy ¶
func (q *InfluxQ) CreateRetentionPolicy(retentionTime time.Duration, rpType RetentionPolicyType) error
Create a retention policy for db
func (*InfluxQ) DropRetentionPolicy ¶
Note: "Dropping a retention policy will permanently delete all measurements and data stored in the retention policy." - influxdb docs
func (*InfluxQ) InitRetentionPolicy ¶
must be called before Start()
func (*InfluxQ) PushAutoProvCounts ¶
func (*InfluxQ) RecvMetric ¶
func (*InfluxQ) WaitConnected ¶
func (*InfluxQ) WaitCreated ¶
type RetentionPolicyType ¶
type RetentionPolicyType int
const ( UnknownRetentionPolicy RetentionPolicyType = iota DefaultRetentionPolicy NonDefaultRetentionPolicy )
Click to show internal directories.
Click to hide internal directories.