counter

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExprs

func GetExprs(groups []*rulefmt.RuleGroups) []string

func GetPromqls

func GetPromqls(boards []sdk.Board) []string

Types

type AnalyzePromqlOutput

type AnalyzePromqlOutput struct {
	Exprs         Counter `json:"exprs,omitempty"`
	Selectors     Counter `json:"selectors,omitempty"`
	Metrics       Counter `json:"metrics,omitempty"`
	NoMetricNames Counter `json:"no_metric_names,omitempty"`
}

func AnalyzePromql

func AnalyzePromql(exprs []string) (AnalyzePromqlOutput, error)

type Counter

type Counter map[string]int

func CountExprs

func CountExprs(exprs []string) Counter

func CountMetricNames

func CountMetricNames(exprs []string) (names, undefined Counter, err error)

func CountSelectors

func CountSelectors(exprs []string) (Counter, error)

func (Counter) Add

func (c Counter) Add(s string)

func (Counter) MarshalJSON

func (c Counter) MarshalJSON() ([]byte, error)

type Output

type Output struct {
	Name  string `json:"name"`
	Count int    `json:"count"`
}

Jump to

Keyboard shortcuts

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