Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RateReporter ¶
type RateReporter struct {
// contains filtered or unexported fields
}
RateReporter maintains score as an exponentially weighted rate
func NewRateReporter ¶
func NewRateReporter(d time.Duration) *RateReporter
NewRateReporter builds a rate reporter over a period of time.
func (*RateReporter) Increment ¶
func (r *RateReporter) Increment(n int64)
Increment increases the rate by n. Typical use case is e.g. the rate of requests, where Increment(1) is called on every request.
func (*RateReporter) Load ¶
func (r *RateReporter) Load(_ context.Context, _ *metrics.LoadRequest) (*metrics.LoadResponse, error)
Load implements github.com/bsm/grpclb/grpclb_backend_v1.LoadReportServer
func (*RateReporter) Score ¶
func (r *RateReporter) Score() int64
Score returns the current load score
type Reporter ¶
type Reporter struct {
// contains filtered or unexported fields
}
func (*Reporter) Increment ¶
Increment allows to adjust load by a certain increment. Typical use case is e.g. the number of server connections, where Increment(1) is called on evert new connect and Increment(-1) on every disconnect.
func (*Reporter) Load ¶
func (r *Reporter) Load(_ context.Context, _ *metrics.LoadRequest) (*metrics.LoadResponse, error)
Load implements github.com/bsm/grpclb/grpclb_backend_v1.LoadReportServer