metrics

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2019 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// metrics prefix
	MetricsPrefix = "gudgeon-"
	// metrics names are prefixed by the metrics prefix and delim
	TotalRules             = "active-rules"
	TotalQueries           = "total-session-queries"
	TotalLifetimeQueries   = "total-lifetime-queries"
	TotalIntervalQueries   = "total-interval-queries"
	CachedQueries          = "cached-queries"
	BlockedQueries         = "blocked-session-queries"
	BlockedLifetimeQueries = "blocked-lifetime-queries"
	BlockedIntervalQueries = "blocked-interval-queries"
	QueryTime              = "query-time"
	// cache entries
	CurrentCacheEntries = "cache-entries"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheSizeFunction added in v0.4.0

type CacheSizeFunction = func() int64

type Metric added in v0.4.4

type Metric struct {
	Count int64 `json:"count"`
}

func (*Metric) Clear added in v0.4.4

func (metric *Metric) Clear() *Metric

func (*Metric) Inc added in v0.4.4

func (metric *Metric) Inc(byValue int64) *Metric

func (*Metric) Set added in v0.4.4

func (metric *Metric) Set(newValue int64) *Metric

func (*Metric) Value added in v0.4.4

func (metric *Metric) Value() int64

type Metrics

type Metrics interface {
	GetAll() map[string]*Metric
	Get(name string) *Metric

	// use cache function
	UseCacheSizeFunction(function CacheSizeFunction)

	// record relevant metrics based on request
	RecordQueryMetrics(request *dns.Msg, response *dns.Msg, rCon *resolver.RequestContext, result *resolver.ResolutionResult)

	// Query metrics from db
	Query(start time.Time, end time.Time) ([]*MetricsEntry, error)

	// stop
	Stop()
}

func New

func New(config *config.GudgeonConfig) Metrics

type MetricsEntry added in v0.3.17

type MetricsEntry struct {
	FromTime        time.Time
	AtTime          time.Time
	Values          map[string]*Metric
	IntervalSeconds int
}

Jump to

Keyboard shortcuts

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