statshub

package
v0.0.0-...-95365cb Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2015 License: Apache-2.0, Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ANY                = "*"
	STREAMING_INTERVAL = 30 * time.Second

	INTERVAL_QUERY_TEMPL = `` /* 253-byte string literal not displayed */

	DIM_WHERE_TEMPL = "AND _dim = '%s'"

	ONE_MINUTE_SECS = 60
	ONE_HOUR_SECS   = 60 * ONE_MINUTE_SECS
	ONE_DAY_DAYS    = 1
	ONE_DAY_SECS    = 24 * ONE_HOUR_SECS
	ONE_WEEK_DAYS   = 7
	ONE_WEEK_SECS   = ONE_WEEK_DAYS * ONE_DAY_SECS
	ONE_MONTH_DAYS  = 30 // Approximation
	ONE_MONTH_SECS  = ONE_MONTH_DAYS * ONE_DAY_SECS
	ONE_YEAR_DAYS   = 365
)

Variables

This section is empty.

Functions

func QueryDims

func QueryDims(dimNames []string) (statsByDim map[string]map[string]*Stats, err error)

QueryDims runs a query for values from the requested dimensions. If dimNames is empty, QueryDims will query all dimensions.

Types

type ClientQueryResponse

type ClientQueryResponse struct {
	Response
	Dims map[string]map[string]*Stats `json:"dims"`
}

ClientQueryResponse is a Response to a StatsQuery

type Response

type Response struct {
	Succeeded bool   `json:"succeeded"`
	Error     string `json:"error"`
}

Response is a response to a stats request (update or query)

type Stats

type Stats struct {
	Counters      map[string]int64    `json:"counters,omitempty"`
	Increments    map[string]int64    `json:"increments,omitempty"`
	Gauges        map[string]int64    `json:"gauges,omitempty"`
	GaugesCurrent map[string]int64    `json:"gaugesCurrent,omitempty"`
	Members       map[string]string   `json:"members,omitempty"`
	MultiMembers  map[string][]string `json:"multiMembers,omitempty"`
}

Stats is a bundle of stats

type StatsUpdate

type StatsUpdate struct {
	Dims map[string]string `json:"dims"`
	Stats
	// contains filtered or unexported fields
}

StatsUpdate posts stats with zero, one or more dimensions. Stats include Counters (cumulative) and Gauges (point in time) (online/offline).

type StreamingQueryResponse

type StreamingQueryResponse struct {
	Response
	Intervals []StreamingQueryResponseInterval `json:"intervals"`
}

ClientQueryResponse is a Response to a StatsQuery

type StreamingQueryResponseInterval

type StreamingQueryResponseInterval struct {
	AsOfSeconds int64            `json:"asOfSeconds"`
	Values      map[string]int64 `json:"values"`
}

Jump to

Keyboard shortcuts

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