prom

package
v0.0.0-...-37f5ccb Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PrometheusQuery

type PrometheusQuery struct {
	Port   int
	Host   string
	Client *http.Client
}

PrometheusQuery represents parameters for querying Prometheus

func NewPrometheusQuery

func NewPrometheusQuery(host string, port int, client *http.Client) PrometheusQuery

NewPrometheusQuery create a NewPrometheusQuery

func (PrometheusQuery) AddMetrics

func (p PrometheusQuery) AddMetrics(inferences []types.InferenceDeployment)

func (PrometheusQuery) Fetch

func (q PrometheusQuery) Fetch(query string) (*VectorQueryResponse, error)

Fetch queries aggregated stats

type PrometheusQueryFetcher

type PrometheusQueryFetcher interface {
	Fetch(query string) (*VectorQueryResponse, error)
}

type VectorQueryResponse

type VectorQueryResponse struct {
	Data struct {
		Result []struct {
			Metric struct {
				Code          string `json:"code"`
				ScalingType   string `json:"scaling_type"`
				InferenceName string `json:"inference_name"`
			}
			Value []interface{} `json:"value"`
		}
	}
}

Jump to

Keyboard shortcuts

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