metrics

package
v2.0.2-rc.19 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultNetwork = "tcp"

Variables

View Source
var (
	DownloadCount = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: constants.MetricsNamespace,
		Subsystem: constants.CDNMetricsName,
		Name:      "download_total",
		Help:      "Counter of the number of the downloading.",
	})

	DownloadFailureCount = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: constants.MetricsNamespace,
		Subsystem: constants.CDNMetricsName,
		Name:      "download_failure_total",
		Help:      "Counter of the number of failed of the downloading.",
	})

	DownloadTraffic = promauto.NewCounter(prometheus.CounterOpts{
		Namespace: constants.MetricsNamespace,
		Subsystem: constants.CDNMetricsName,
		Name:      "download_traffic",
		Help:      "Counter of the number of download traffic.",
	})

	ConcurrentDownloadGauge = promauto.NewGauge(prometheus.GaugeOpts{
		Namespace: constants.MetricsNamespace,
		Subsystem: constants.CDNMetricsName,
		Name:      "concurrent_download_total",
		Help:      "Gauger of the number of concurrent of the downloading.",
	})
)

Variables declared for metrics.

Functions

This section is empty.

Types

type Config added in v2.0.2

type Config struct {
	Net  string `yaml:"net" mapstructure:"net"`
	Addr string `yaml:"addr" mapstructure:"addr"`
}

func DefaultConfig added in v2.0.2

func DefaultConfig() Config

func (Config) Validate added in v2.0.2

func (c Config) Validate() []error

type Server added in v2.0.2

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

func New

func New(config Config, rpcServer *grpc.Server) (*Server, error)

func (*Server) Handler added in v2.0.2

func (s *Server) Handler() http.Handler

Handler returns an http handler for the blob server.

func (*Server) ListenAndServe added in v2.0.2

func (s *Server) ListenAndServe(h http.Handler) error

ListenAndServe is a blocking call which runs s.

func (*Server) Shutdown added in v2.0.2

func (s *Server) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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