pmseries

package
v0.0.6-0...-1a318ba Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	Ping() (GenericSuccessResponse, error)
	Query(expr string) (QueryResponse, error)
	Metrics(series []string) ([]MetricsResponseItem, error)
	MetricNames(pattern string) (MetricNamesResponse, error)
	Descs(series []string) ([]DescsResponseItem, error)
	Instances(series []string) ([]InstancesResponseItem, error)
	Labels(series []string) ([]LabelsResponseItem, error)
	LabelNames(pattern string) (LabelNamesResponse, error)
	LabelValues(labelNames []string) (LabelValuesResponse, error)
	Values(series []string, start int64, finish int64, interval int64) ([]ValuesResponseItem, error)
}

func NewPmseriesAPI

func NewPmseriesAPI(pmproxyUrl string, basicAuth *BasicAuthSettings) (API, error)

NewPmseriesAPI constructs a new PmseriesAPI struct

type BasicAuthSettings

type BasicAuthSettings struct {
	Username string
	Password string
}

type DescsResponseItem

type DescsResponseItem struct {
	Series    string `json:"series"`
	Source    string `json:"source"`
	PMID      string `json:"pmid"`
	Indom     string `json:"indom"`
	Semantics string `json:"semantics"`
	Type      string `json:"type"`
	Units     string `json:"units"`
}

type GenericErrorResponse

type GenericErrorResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type GenericSuccessResponse

type GenericSuccessResponse struct {
	Success bool `json:"success"`
}

type InstancesResponseItem

type InstancesResponseItem struct {
	Series   string `json:"series"`
	Source   string `json:"source"`
	Instance string `json:"instance"`
	ID       int    `json:"id"`
	Name     string `json:"name"`
}

type LabelNamesResponse

type LabelNamesResponse []string

type LabelValuesResponse

type LabelValuesResponse map[string][]interface{}

type LabelsResponseItem

type LabelsResponseItem struct {
	Series string                 `json:"series"`
	Labels map[string]interface{} `json:"labels"`
}

type MetricNamesResponse

type MetricNamesResponse []string

type MetricsResponseItem

type MetricsResponseItem struct {
	Series string `json:"series"`
	Name   string `json:"name"`
}

type QueryResponse

type QueryResponse []string

type ValuesResponseItem

type ValuesResponseItem struct {
	Series    string  `json:"series"`
	Timestamp float64 `json:"timestamp"` // milliseconds
	Instance  string  `json:"instance"`  // can be empty
	Value     string  `json:"value"`
}

Jump to

Keyboard shortcuts

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