monitor

package
v2.2.0-alpha5+incompat... Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceNode              = "node"
	ResourceCluster           = "cluster"
	ResourceEtcd              = "etcd"
	ResourceAPIServer         = "apiserver"
	ResourceScheduler         = "scheduler"
	ResourceControllerManager = "controllermanager"
	ResourceIngressController = "ingressController"
	ResourceFluentd           = "fluentd"
	ResourceWorkload          = "workload"
	ResourcePod               = "pod"
	ResourceContainer         = "container"
)

Variables

This section is empty.

Functions

func GraphFormatter

func GraphFormatter(apiContext *types.APIContext, resource *types.RawResource)

func MetricCollectionFormatter

func MetricCollectionFormatter(apiContext *types.APIContext, collection *types.GenericCollection)

func MetricFormatter

func MetricFormatter(apiContext *types.APIContext, resource *types.RawResource)

func NewTimePoint

func NewTimePoint(value, timestamp float64) (po []float64, isValid bool)

func QueryGraphCollectionFormatter

func QueryGraphCollectionFormatter(apiContext *types.APIContext, collection *types.GenericCollection)

Types

type ClusterGraphHandler

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

func NewClusterGraphHandler

func NewClusterGraphHandler(dialerFactory dialer.Factory, clustermanager *clustermanager.Manager) *ClusterGraphHandler

func (*ClusterGraphHandler) QuerySeriesAction

func (h *ClusterGraphHandler) QuerySeriesAction(actionName string, action *types.Action, apiContext *types.APIContext) error

type Interval

type Interval struct {
	Text  string
	Value time.Duration
}

type IntervalCalculator

type IntervalCalculator interface {
	Calculate(timeRange *TimeRange, minInterval time.Duration) Interval
}

type IntervalOptions

type IntervalOptions struct {
	MinInterval time.Duration
}

type MetricHandler

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

func NewMetricHandler

func NewMetricHandler(dialerFactory dialer.Factory, clustermanager *clustermanager.Manager) *MetricHandler

func (*MetricHandler) Action

func (h *MetricHandler) Action(actionName string, action *types.Action, apiContext *types.APIContext) error

type ProjectGraphHandler

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

func NewProjectGraphHandler

func NewProjectGraphHandler(dialerFactory dialer.Factory, clustermanager *clustermanager.Manager) *ProjectGraphHandler

func (*ProjectGraphHandler) QuerySeriesAction

func (h *ProjectGraphHandler) QuerySeriesAction(actionName string, action *types.Action, apiContext *types.APIContext) error

type PrometheusQuery

type PrometheusQuery struct {
	ID              string
	Expr            string
	Step            time.Duration
	Start           time.Time
	End             time.Time
	LegendFormat    string
	IsInstanceQuery bool
}

func InitPromQuery

func InitPromQuery(id string, start, end time.Time, step time.Duration, expr, format string, isInstanceQuery bool) *PrometheusQuery

type Queries

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

func NewPrometheusQuery

func NewPrometheusQuery(ctx context.Context, userContext *config.UserContext, clusterName, authToken string, clustermanager *clustermanager.Manager, dialerFactory dialer.Factory) (*Queries, error)

func (*Queries) Do

func (q *Queries) Do(querys []*PrometheusQuery) (map[string][]*TimeSeries, error)

func (*Queries) GetLabelValues

func (q *Queries) GetLabelValues(labelName string) ([]string, error)

func (*Queries) Query

func (q *Queries) Query(query *PrometheusQuery) ([]*TimeSeries, error)

func (*Queries) QueryRange

func (q *Queries) QueryRange(query *PrometheusQuery) ([]*TimeSeries, error)

type TimeRange

type TimeRange struct {
	From string
	To   string
	// contains filtered or unexported fields
}

func NewTimeRange

func NewTimeRange(from, to string) *TimeRange

func (*TimeRange) MustGetFrom

func (tr *TimeRange) MustGetFrom() time.Time

func (*TimeRange) MustGetTo

func (tr *TimeRange) MustGetTo() time.Time

func (*TimeRange) ParseFrom

func (tr *TimeRange) ParseFrom() (time.Time, error)

func (*TimeRange) ParseTo

func (tr *TimeRange) ParseTo() (time.Time, error)

type TimeSeries

type TimeSeries struct {
	Name   string            `json:"name"`
	Points [][]float64       `json:"points"`
	Tags   map[string]string `json:"tags"`
}

Jump to

Keyboard shortcuts

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