health

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2016 License: MIT Imports: 4 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 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.

You can visit /api/info for health info.

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 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"`
	// Aggregation
	DetectionCost     float64 `json:"detectionCost.5min"` // ms
	NumMetricIncomed  int64   `json:"numMetricIncome.5min"`
	NumMetricDetected int64   `json:"numMetricDetected.5min"`
	NumAlertingEvents int64   `json:"numAlertingEvents.5min"`
	// 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