Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SamplingIntervalInSeconds - interval is 30 seconds // it is important that Prometheus scraping must be set to 30 seconds the same as this samping interval SamplingIntervalInSeconds = 30 // DefaultUsageByteLimit is set to 100GB DefaultUsageByteLimit = 100000000000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TenantsUsage ¶
type TenantsUsage struct {
// contains filtered or unexported fields
}
TenantsUsage manages the tenant usage metering
func NewTenantsUsage ¶
func NewTenantsUsage(url, pulsarToken, clusterName string, tenantByteOutLimit uint64) *TenantsUsage
NewTenantsUsage creates a TenantsUsage
func (*TenantsUsage) PromGauge ¶
func (t *TenantsUsage) PromGauge(gaugeType, tenant string, num uint64)
PromGauge registers gauge reading
func (*TenantsUsage) ReportHighUsageTenant ¶
func (t *TenantsUsage) ReportHighUsageTenant() (errStr string)
ReportHighUsageTenant reports high usage tenant as error return type
func (*TenantsUsage) UpdateUsages ¶
func (t *TenantsUsage) UpdateUsages()
UpdateUsages computes the usage by comparing with the last use
type Usage ¶
type Usage struct { Name string `json:"name"` TotalMessagesIn uint64 `json:"totalMessagesIn"` TotalBytesIn uint64 `json:"totalBytesIn"` TotalMessagesOut uint64 `json:"totalMessagesOut"` TotalBytesOut uint64 `json:"totalBytesOut"` MsgInBacklog uint64 `json:"msgInBacklog"` UpdatedAt time.Time `json:"updatedAt"` }
Usage is the data usage per single tenant
Click to show internal directories.
Click to hide internal directories.