Versions in this module Expand all Collapse all v1 v1.2.1 Aug 20, 2020 v1.2.0 Aug 20, 2020 Changes in this version + const APNLabel + const DaysLabel + const DirectionLabel + type APThroughputCalculation struct + Direction ConsumptionDirection + QueryStepSize time.Duration + func (x *APThroughputCalculation) Calculate(prometheusClient PrometheusAPI) ([]Result, error) + type Analyzer interface + Run func() + Schedule func(schedule string) error + func NewPrometheusAnalyzer(prometheusClient v1.API, calculations []Calculation, exporter Exporter) Analyzer + type Calculation interface + Calculate func(PrometheusAPI) ([]Result, error) + type CalculationParams struct + Days int + Labels prometheus.Labels + Name string + RegisteredGauge *prometheus.GaugeVec + type ConsumptionDirection string + const ConsumptionIn + const ConsumptionOut + type Exporter interface + Export func(Result, HttpClient) error + func NewWWWExporter(metricsPrefix, appSecret, appID, metricExportURL, categoryName string) Exporter + type HttpClient interface + PostForm func(url string, data url.Values) (resp *http.Response, err error) + type PrometheusAPI interface + Query func(ctx context.Context, query string, ts time.Time) (model.Value, api.Warnings, error) + QueryRange func(ctx context.Context, query string, r v1.Range) (model.Value, api.Warnings, error) + type PrometheusAnalyzer struct + Calculations []Calculation + Cron *cron.Cron + Exporter Exporter + PrometheusClient PrometheusAPI + func (a *PrometheusAnalyzer) Analyze() + func (a *PrometheusAnalyzer) Run() + func (a *PrometheusAnalyzer) Schedule(schedule string) error + type Result struct + type UserConsumptionCalculation struct + Direction ConsumptionDirection + func (x *UserConsumptionCalculation) Calculate(prometheusClient PrometheusAPI) ([]Result, error) + type UserThroughputCalculation struct + Direction ConsumptionDirection + QueryStepSize time.Duration + func (x *UserThroughputCalculation) Calculate(prometheusClient PrometheusAPI) ([]Result, error) + type XAPCalculation struct + ThresholdBytes int + func (x *XAPCalculation) Calculate(prometheusClient PrometheusAPI) ([]Result, error)