cb

package
v0.0.0-...-a294835 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCBMiddleware

func NewCBMiddleware(cfg Config) func(http.Handler) http.Handler

NewCBMiddleware creates a new cb middleware

func NewCollectorRegistry

func NewCollectorRegistry(client client.Client) func(string) metricCollector.MetricCollector

NewCollectorRegistry returns a function to be registerd with metricCollector.Registry.Register(NewCollectorRegistry).

Types

type Config

type Config struct {
	hystrix.CommandConfig
	Name      string `json:"name"`
	Predicate string `json:"predicate"`
}

Config represents the Body Limit configuration

type StatsCollector

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

StatsCollector fulfills the metricCollector interface allowing users to ship circuit stats to a metric backend. To use users must call InitializeStatsCollector before circuits are started.

func NewStatsCollector

func NewStatsCollector(name string, client client.Client) (*StatsCollector, error)

NewStatsCollector creates a collector for a specific circuit. The prefix given to this circuit will be {config.Prefix}.{circuit_name}.{metric}. Circuits with "/" in their names will have them replaced with ".".

func (*StatsCollector) Reset

func (g *StatsCollector) Reset()

Reset is a noop operation in this collector.

func (*StatsCollector) Update

Update metrics

Jump to

Keyboard shortcuts

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