metrics

package
v0.0.0-...-e2be882 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Name   string `json:"name"`
	Enable bool   `json:"enable"`
	Query  string `json:"query"`
}

type AnnotationInstance

type AnnotationInstance struct {
	Title    string   `json:"title"`
	Text     string   `json:"text"`
	Time     int64    `json:"time"`
	IsRegion bool     `json:"isRegion"`
	TimeEnd  int64    `json:"timeEnd"`
	Tags     []string `json:"tags"`
}

type AnnotationQuery

type AnnotationQuery struct {
	Range      cointime.Range `json:"range"`
	Annotation Annotation
}

type AnnotationsQuery

type AnnotationsQuery func(query string) []AnnotationInstance

type Column

type Column struct {
	Text string `json:"text"`
	Type string `json:"type"`
}

type Filter

type Filter struct {
	Key      string `json:"key"`
	Operator string `json:"operator"`
	Value    string `json:"value"`
}

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}
var Observer *Metrics

func (*Metrics) AddTrades

func (m *Metrics) AddTrades(f float64, labels ...string)

func (*Metrics) IncrementCalls

func (m *Metrics) IncrementCalls(labels ...string)

func (*Metrics) IncrementErrors

func (m *Metrics) IncrementErrors(labels ...string)

func (*Metrics) IncrementEvents

func (m *Metrics) IncrementEvents(labels ...string)

func (*Metrics) IncrementTrades

func (m *Metrics) IncrementTrades(labels ...string)

func (*Metrics) NoteLag

func (m *Metrics) NoteLag(f float64, labels ...string)

func (*Metrics) TrackDuration

func (m *Metrics) TrackDuration(f float64, labels ...string)

type Points

type Points [][]float64

func (Points) Len

func (p Points) Len() int

func (Points) Less

func (p Points) Less(i, j int) bool

func (Points) Swap

func (p Points) Swap(i, j int)

type Query

type Query struct {
	PanelID       int               `json:"panelId"`
	Range         cointime.Range    `json:"range"`
	Interval      cointime.Duration `json:"interval"`
	IntervalMS    int64             `json:"intervalMs"`
	Targets       []Target          `json:"targets"`
	MaxDataPoints int               `json:"maxDataPoints"`
	AdhocFilters  []Filter
}

type Series

type Series struct {
	Target     string `json:"target"`
	DataPoints Points `json:"datapoints"`
}

type Server

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

func NewServer

func NewServer(name string, port int) *Server

func (*Server) Annotate

func (s *Server) Annotate(annotation string, query AnnotationsQuery) *Server

func (*Server) Run

func (s *Server) Run()

func (*Server) Tag

func (s *Server) Tag(tag string, query TagQuery) *Server

func (*Server) Target

func (s *Server) Target(target string, query TargetQuery) *Server

type Table

type Table struct {
	Columns []Column   `json:"columns"`
	Rows    [][]string `json:"rows"`
	Type    string     `json:"type"`
}

func NewTable

func NewTable() Table

type Tag

type Tag struct {
	Key  string `json:"key"`
	Type string `json:"type"`
	Text string `json:"text"`
}

type TagQuery

type TagQuery func() []string

type Target

type Target struct {
	RefID  string                 `json:"refId"`
	Target string                 `json:"target"`
	Type   string                 `json:"type"`
	Data   map[string]interface{} `json:"data"`
}

type TargetQuery

type TargetQuery func(data map[string]interface{}, timeRange time.Range) []Series

Jump to

Keyboard shortcuts

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