server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSampleTypeMapping = map[string]*SampleTypeConfig{
	"samples": {
		DisplayName: "cpu",
		Units:       "samples",
		Sampled:     true,
	},
	"inuse_objects": {
		Units:       "objects",
		Aggregation: "avg",
	},
	"alloc_objects": {
		Units:      "objects",
		Cumulative: true,
	},
	"inuse_space": {
		Units:       "bytes",
		Aggregation: "avg",
	},
	"alloc_space": {
		Units:      "bytes",
		Cumulative: true,
	},
}

Functions

func NewIngestHandler added in v0.3.0

func NewIngestHandler(log *logrus.Logger, st *storage.Storage, exporter storage.MetricsExporter, onSuccess func(pi *storage.PutInput)) http.Handler

func WriteError added in v0.3.0

func WriteError(log *logrus.Logger, w http.ResponseWriter, code int, err error, msg string)

func WriteErrorMessage added in v0.3.0

func WriteErrorMessage(log *logrus.Logger, w http.ResponseWriter, code int, msg string)

Types

type Config added in v0.2.1

type Config struct {
	Configuration *config.Server
	*logrus.Logger
	*storage.Storage
	Notifier

	// The registerer is used for exposing server metrics.
	MetricsRegisterer prometheus.Registerer

	// Exported metrics registry and exported.
	ExportedMetricsRegistry *prometheus.Registry
	storage.MetricsExporter
}

type Controller

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

func New

func New(c Config) (*Controller, error)

func (*Controller) AppsCount added in v0.0.13

func (ctrl *Controller) AppsCount() int

func (*Controller) Drain added in v0.0.34

func (ctrl *Controller) Drain()

func (*Controller) Start

func (ctrl *Controller) Start() error

func (*Controller) Stats added in v0.0.13

func (ctrl *Controller) Stats() map[string]int

func (*Controller) Stop added in v0.0.30

func (ctrl *Controller) Stop() error

type Notifier added in v0.2.2

type Notifier interface {
	// NotificationText returns message that will be displayed to user
	// on index page load. The message should point user to a critical problem.
	// TODO(kolesnikovae): we should poll for notifications (or subscribe).
	NotificationText() string
}

type RenderDiffParams added in v0.0.38

type RenderDiffParams struct {
	Name  *string `json:"name,omitempty"`
	Query *string `json:"query,omitempty"`

	From  string `json:"from"`
	Until string `json:"until"`

	Format   string `json:"format"`
	MaxNodes *int   `json:"maxNodes,omitempty"`

	Left  RenderTreeParams `json:"leftParams"`
	Right RenderTreeParams `json:"rightParams"`
}

type RenderTreeParams added in v0.0.38

type RenderTreeParams struct {
	From  string `json:"from"`
	Until string `json:"until"`
}

type SampleTypeConfig added in v0.3.0

type SampleTypeConfig struct {
	Units       string `json:"units,omitempty"`
	DisplayName string `json:"display-name,omitempty"`

	//  instant:    Aggregation:avg && !Cumulative && !Sampled
	//  cumulative: Aggregation:sum && Cumulative  && !Sampled
	//  delta:      Aggregation:sum && !Cumulative && Sampled
	Aggregation string `json:"aggregation,omitempty"`
	Cumulative  bool   `json:"cumulative,omitempty"`
	Sampled     bool   `json:"sampled,omitempty"`
}

TODO: dedup this with the version in scrape package

Jump to

Keyboard shortcuts

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