health

package
v0.0.0-...-299c846 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package health implements the health statistic aggregation.

// Total
aggregationInterval           // Health aggregation interval, 300s (5min)
numIndexTotal                 // Number of metric indexes total.
numClients                    // Number of detector clients.
// Aggregation
detectionCost                 // Average of detection time cost (in milliseconds) in last interval.
numMetricIncomed              // Number of metrics incomed in last interval.
numMetricDetected             // Number of metrics detected in last interval.
numAlertingEvents             // Number of alerting events in last interval.

Index

Constants

View Source
const AggregationInterval int = 5 * 60

AggregationInterval in seconds, default: 5min

Variables

This section is empty.

Functions

func AddDetectionCost

func AddDetectionCost(n float64)

AddDetectionCost appends cost to DetectionCosts.

func AddFilterCost

func AddFilterCost(n float64)

AddFilterCost appends cost to FilterCosts.

func DecrNumClients

func DecrNumClients(n int64)

DecrNumClients decrments NumClients by n.

func IncrNumAlertingEvents

func IncrNumAlertingEvents(n int64)

IncrNumAlertingEvents increments NumAlertingsEvents by n.

func IncrNumClients

func IncrNumClients(n int64)

IncrNumClients increments NumClients by n.

func IncrNumMetricDetected

func IncrNumMetricDetected(n int64)

IncrNumMetricDetected increments NumMetricDetected by n.

func IncrNumMetricIncomed

func IncrNumMetricIncomed(n int64)

IncrNumMetricIncomed increments NumMetricIncomed by n.

func Init

func Init(db *storage.DB)

Init hub.

func Start

func Start()

Start the health aggregator.

Types

type Info

type Info struct {

	// Total
	AggregationInterval int   `json:"aggregationInterval"`
	NumIndexTotal       int   `json:"numIndexTotal"`
	NumClients          int64 `json:"numClients"`
	NumRules            int   `json:"numRules"`
	// Aggregation
	DetectionCost     float64 `json:"detectionCost"` // ms
	FilterCost        float64 `json:"filterCost"`    // ms
	NumMetricIncomed  int64   `json:"numMetricIncomed"`
	NumMetricDetected int64   `json:"numMetricDetected"`
	NumAlertingEvents int64   `json:"numAlertingEvents"`
	// contains filtered or unexported fields
}

Info is the stats container.

func Get

func Get() *Info

Get info.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL