Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type Calculator interface {
GetQuota() float64
}
type ClusterAwareNamespaceQuotaCalculator ¶
ClusterAwareNamespaceQuotaCalculator is similar to ClusterAwareQuotaCalculator, but it uses quotas that are specific to a namespace.
func (ClusterAwareNamespaceQuotaCalculator) GetQuota ¶
func (l ClusterAwareNamespaceQuotaCalculator) GetQuota(namespace string) float64
type ClusterAwareQuotaCalculator ¶
type ClusterAwareQuotaCalculator quotaCalculator[func() int]
ClusterAwareQuotaCalculator calculates the available quota for the current host based on the per instance and per cluster quota. The quota could represent requests per second, total number of active requests, etc. It works by dividing the per cluster quota by the total number of instances running the same service.
func (ClusterAwareQuotaCalculator) GetQuota ¶
func (l ClusterAwareQuotaCalculator) GetQuota() float64
type LoggedCalculator ¶
type LoggedCalculator struct {
// contains filtered or unexported fields
}
func NewLoggedCalculator ¶
func NewLoggedCalculator( calculator Calculator, logger log.Logger, ) *LoggedCalculator
func (*LoggedCalculator) GetQuota ¶
func (c *LoggedCalculator) GetQuota() float64
type LoggedNamespaceCalculator ¶
type LoggedNamespaceCalculator struct {
// contains filtered or unexported fields
}
func NewLoggedNamespaceCalculator ¶
func NewLoggedNamespaceCalculator( calculator NamespaceCalculator, logger log.Logger, ) *LoggedNamespaceCalculator
func (*LoggedNamespaceCalculator) GetQuota ¶
func (c *LoggedNamespaceCalculator) GetQuota(namespace string) float64
type MemberCounter ¶
type MemberCounter interface {
AvailableMemberCount() int
}
MemberCounter returns the total number of instances there are for a given service.
type NamespaceCalculator ¶
Click to show internal directories.
Click to hide internal directories.