Documentation
¶
Index ¶
- type Bucket
- type Influx
- func (i *Influx) Cardinality(b *Bucket, inst string) (int, error)
- func (i *Influx) Downsample(b *Bucket, inst string, col string) error
- func (i *Influx) GetAllInstances(b *Bucket, c string) ([]string, error)
- func (i *Influx) GetDsInstances(b *Bucket, c string) (map[string][]string, error)
- func (i *Influx) GetMemUsage() (*float64, error)
- func (i *Influx) GetRunningTasks() (*float64, error)
- func (i *Influx) IsBwUtilDone(inst string) (bool, error)
- func (i *Influx) LastTS(b *Bucket, inst, col string) (time.Time, error)
- func (i *Influx) StoreBwUsage(inst string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct { From *Bucket Name string AInterv time.Duration RPeriod time.Duration First bool }
bucket parameters
type Influx ¶
type Influx struct { Client influxdb2.Client Org string Statsb string Bwb string DsMemLimit float64 AggrCnt int CardMedium int CardHevy int DbHasResources bool }
influxdb parameters
func (*Influx) Cardinality ¶
Cardinality retrieves the cardinality for a given instance in a bucket.
Parameters:
b *Bucket - the bucket object inst string - the instance name
Returns:
int - the cardinality count error - an error, if any
func (*Influx) Downsample ¶
Downsample performs downsampling of measurements of the given instance in the bucket based on collection. It returns an error, if any.
func (*Influx) GetAllInstances ¶ added in v0.1.2
GetAllInstances retrieves instances for the given bucket based on collection type.
Parameters:
b: *Bucket - the bucket for which to retrieve instances c: string - the collection type
Return:
[]string - a slice of instances error - an error, if any
func (*Influx) GetDsInstances ¶
GetDsInstances retrieves instances for the given bucket based on collection type, and groups them by cardinality.
Parameters:
b: *Bucket - the bucket for which to retrieve instances c: string - the collection type
Return:
map[string][]string - a map of instance groups by cardinality error - an error, if any
func (*Influx) GetMemUsage ¶
GetMemUsage retrieves the memory usage percentage from Influx database.
No parameters. Returns a pointer to float64 and an error.
func (*Influx) GetRunningTasks ¶
GetRunningTasks retrieves the count of running tasks from InfluxDB.
Returns a pointer to float64 and an error.
func (*Influx) IsBwUtilDone ¶ added in v0.1.2
IsBwUtilDone returns true if bandwidth data for yesterday is available for a given instance.
Parameters:
inst string - the instance name
Return:
bool - true/false error - any error that occurred during the query
func (*Influx) LastTS ¶
LastTS returns the timestamp of the latest data point for a given instance in a bucket based on collection.
Parameters:
b *Bucket - the bucket to query inst string - the instance name col string - the collection
Return:
time.Time - the timestamp of the latest data point error - any error that occurred during the query
func (*Influx) StoreBwUsage ¶ added in v0.1.2
StoreBwUsage performs eth port bandwidth usage calculation and storage for given instance. It returns an error, if any.