Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllowPrometheusSync

func AllowPrometheusSync(logf logging.FormatLogger)

    AllowPrometheusSync sleeps for sometime to allow prometheus time to scrape the metrics.

    func PromAPI

    func PromAPI() (v1.API, error)

      PromAPI gets a handle to the prometheus API

      func RunQuery

      func RunQuery(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string) (float64, error)

        RunQuery runs a prometheus query and returns the metric value

        func RunQueryRange

        func RunQueryRange(ctx context.Context, logf logging.FormatLogger, promAPI v1.API, query string, r v1.Range) (float64, error)

          RunQueryRange runs a prometheus query over the given range

          func VectorValue

          func VectorValue(val model.Value) (float64, error)

            VectorValue gets the vector value from the value type

            Types

            type PromProxy

            type PromProxy struct {
            	Namespace string
            	// contains filtered or unexported fields
            }

              PromProxy defines a proxy to the prometheus server

              func (*PromProxy) Setup

              func (p *PromProxy) Setup(ctx context.Context, kubeClientset kubernetes.Interface, logf logging.FormatLogger)

                Setup performs a port forwarding for app prometheus-test in given namespace

                func (*PromProxy) Teardown

                func (p *PromProxy) Teardown(logf logging.FormatLogger)

                  Teardown will kill the port forwarding process if running.

                  Source Files