notifier

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PrefixCountPS is the prefix of call counter metric per time unit metric name
	PrefixCountPS = "timer.count_ps."
	// PrefixMean90 is the prefix ofprefix of mean response time metric name
	PrefixMean90 = "timer.mean_90."
	// PrefixUpper90 is the prefix of upper 90 response time metric name
	PrefixUpper90 = "timer.upper_90."
	// PrefixCounter is the  prefix of counter metric name
	PrefixCounter = "counter."
	// PrefixGauge is the prefix of gauge metric name
	PrefixGauge = "gauge."
)

Variables

View Source
var (
	// Magnitudes contains six magnitude unit
	Magnitudes = []string{"", "K", "M", "G", "T", "P"}
	// RuleLevels contains  three rule level
	RuleLevels = []string{"低", "中", "高"}
)

Functions

func Init

func Init(config *config.Config)

Init Notifier

Types

type Event

type Event struct {
	ID      string          `json:"id"`
	Comment string          `json:"comment"`
	Metric  *models.Metric  `json:"metric"`
	Rule    *models.Rule    `json:"rule"`
	Project *models.Project `json:"project"`
	Team    *models.Team    `json:"team"`
}

Event is the webhook payload

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

Slack Notifier

func (*Slack) Notify

func (s *Slack) Notify(hook models.WebHook, ew *models.EventWrapper) error

Notify metric event

type WebHook

type WebHook struct{}

WebHook notifier

func (*WebHook) Notify

func (w *WebHook) Notify(hook models.WebHook, ew *models.EventWrapper) error

Notify event

Jump to

Keyboard shortcuts

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