Documentation
¶
Index ¶
- Variables
- type Config
- func (cfg *Config) ClientWithRegisterer(client *http.Client, reg prometheus.Registerer) (*http.Client, error)
- func (cfg *Config) RegisterFlags(f *flag.FlagSet)
- func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
- func (cfg *Config) RoundTripper(next http.RoundTripper) (http.RoundTripper, error)
- func (cfg *Config) RoundTripperWithRegisterer(next http.RoundTripper, reg prometheus.Registerer) (http.RoundTripper, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrTooManyHedgeRequests = errors.New("too many hedge requests")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// At is the duration after which a second request will be issued.
At time.Duration `yaml:"at"`
// UpTo is the maximum number of requests that will be issued.
UpTo int `yaml:"up_to"`
// The maximun of hedge requests allowed per second.
MaxPerSecond int `yaml:"max_per_second"`
}
Config is the configuration for hedging requests.
func (*Config) ClientWithRegisterer ¶
func (cfg *Config) ClientWithRegisterer(client *http.Client, reg prometheus.Registerer) (*http.Client, error)
ClientWithRegisterer returns a hedged http client with instrumentation registered to the provided registerer. The client transport will be mutated to use the hedged roundtripper.
func (*Config) RegisterFlags ¶
RegisterFlags registers flags.
func (*Config) RegisterFlagsWithPrefix ¶
RegisterFlagsWithPrefix registers flags with prefix.
func (*Config) RoundTripper ¶
func (cfg *Config) RoundTripper(next http.RoundTripper) (http.RoundTripper, error)
RoundTripper returns a hedged roundtripper.
func (*Config) RoundTripperWithRegisterer ¶
func (cfg *Config) RoundTripperWithRegisterer(next http.RoundTripper, reg prometheus.Registerer) (http.RoundTripper, error)
RoundTripperWithRegisterer returns a hedged roundtripper with instrumentation registered to the provided registerer.
Click to show internal directories.
Click to hide internal directories.