monitoring

package
v0.0.0-...-927e444 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright 2018 The JIMDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2018 The JIMDB Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExponentialBuckets

func ExponentialBuckets(start, factor float64, count int) []float64

func ProcessMonitor

func ProcessMonitor(ctx context.Context, m Monitor, interval time.Duration)

func Register

func Register(name string, monitor Monitor)

Types

type Alarm

type Alarm interface {
	Alarm(string)
}

type Counter

type Counter interface {
	// Inc increments the counter by 1. Use Add to increment it by arbitrary
	// non-negative values.
	Inc()
}

type Gauge

type Gauge interface {
	// Set sets the Gauge to an arbitrary value.
	Set(float64)
	// Inc increments the Gauge by 1. Use Add to increment it by arbitrary
	// values.
	Inc()
	// Dec decrements the Gauge by 1. Use Sub to decrement it by arbitrary
	// values.
	Dec()
	// Add adds the given value to the Gauge. (The value can be negative,
	// resulting in a decrease of the Gauge.)
	Add(float64)
	// Sub subtracts the given value from the Gauge. (The value can be
	// negative, resulting in an increase of the Gauge.)
	Sub(float64)
}

type Monitor

type Monitor interface {
	// call init() before all other API
	Init(cluster, instance string, pushGateway string, pushInterval time.Duration)
	// register must call before Start()
	RegisterCounter(nameSpace, subSystem, name string, labelNames []string)
	RegisterGauge(nameSpace, subSystem, name string, labelNames []string)

	// after start(), call register will panic
	Start()
	Stop()
	Push()
	GetInstance() string
	GetCluster() string
	GetPushGatewayUrl() string
	GetCounter(nameSpace, subSystem, name string, lvs ...string) Counter
	GetGauge(nameSpace, subSystem, name string, lvs ...string) Gauge
}

func Load

func Load(name string) Monitor

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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