Documentation ¶
Index ¶
- Variables
- type Option
- type Throttler
- func (t *Throttler) Close() error
- func (Throttler) HostPort(hostPort string) Option
- func (t *Throttler) IsAllowed(operation string) bool
- func (Throttler) Logger(logger jaeger.Logger) Option
- func (Throttler) Metrics(m *jaeger.Metrics) Option
- func (Throttler) RefreshInterval(refreshInterval time.Duration) Option
- func (t *Throttler) SetProcess(process jaeger.Process)
- func (Throttler) SynchronousInitialization(b bool) Option
Constants ¶
This section is empty.
Variables ¶
var Options options
Options is a factory for all available options
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(options *options)
Option is a function that sets some option on the Throttler
type Throttler ¶
type Throttler struct {
// contains filtered or unexported fields
}
Throttler retrieves credits from agent and uses it to throttle operations.
func NewThrottler ¶
NewThrottler returns a Throttler that polls agent for credits and uses them to throttle the service.
func (Throttler) HostPort ¶
HostPort creates an Option that sets the hostPort of the local agent that keeps track of credits.
func (Throttler) Logger ¶
func (Throttler) Logger(logger jaeger.Logger) Option
Logger creates an Option that sets the logger used by the Throttler.
func (Throttler) Metrics ¶
func (Throttler) Metrics(m *jaeger.Metrics) Option
Metrics creates an Option that initializes Metrics on the Throttler, which is used to emit statistics.
func (Throttler) RefreshInterval ¶
RefreshInterval creates an Option that sets how often the Throttler will poll local agent for credits.
func (*Throttler) SetProcess ¶
func (t *Throttler) SetProcess(process jaeger.Process)
SetProcess implements ProcessSetter#SetProcess. It's imperative that the UUID is set before any remote requests are made.
func (Throttler) SynchronousInitialization ¶
SynchronousInitialization creates an Option that determines whether the throttler should synchronously fetch credits from the agent when an operation is seen for the first time. This should be set to true if the client will be used by a short lived service that needs to ensure that credits are fetched upfront such that sampling or throttling occurs.