Documentation ¶
Index ¶
- func DecrementMasterUserRecordCount(logger logr.Logger, domain metrics.Domain)
- func DecrementSpaceCount(logger logr.Logger, clusterName string)
- func IncrementMasterUserRecordCount(logger logr.Logger, domain metrics.Domain)
- func IncrementSpaceCount(logger logr.Logger, clusterName string)
- func Reset()
- func Synchronize(ctx context.Context, cl runtimeclient.Client, ...) error
- func UpdateUsersPerActivationCounters(logger logr.Logger, activations int, domain metrics.Domain)
- type Counts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecrementMasterUserRecordCount ¶
DecrementMasterUserRecordCount decreases the number of MasterUserRecord in the cached counter
func DecrementSpaceCount ¶
DecrementSpaceCount decreases the number of Spaces for the given member cluster in the cached counter
func IncrementMasterUserRecordCount ¶
IncrementMasterUserRecordCount increments the number of MasterUserRecord in the cached counter
func IncrementSpaceCount ¶
IncrementSpaceCount increments the number of Space's for the given member cluster in the cached counter
func Synchronize ¶
func Synchronize(ctx context.Context, cl runtimeclient.Client, toolchainStatus *toolchainv1alpha1.ToolchainStatus) error
Synchronize synchronizes the content of the ToolchainStatus with the cached counter
If the counter hasn't been initialized yet, then it adds the actual cached count to the one taken from ToolchainStatus and marks the cached as initialized
If the ToolchainStatus doesn't contain any MUR counts, then it lists all existing MURs, counts them and stores in both cache and ToolchainStatus object
If the cached counter is initialized and ToolchainStatus contains already some numbers then it updates the ToolchainStatus numbers with the one taken from the cached counter
func UpdateUsersPerActivationCounters ¶
UpdateUsersPerActivationCounters updates the activation counters and metrics When a user signs up for the 1st time, her `activations` number is `1`, on the second time, it's `2`, etc.
Types ¶
type Counts ¶
type Counts struct { // MasterUserRecordPerDomainCounts the number of MasterUserRecords per email address domain (`internal` vs `external`) MasterUserRecordPerDomainCounts map[string]int // SpacesPerClusterCounts the number of UserAccounts by cluster name SpacesPerClusterCounts map[string]int // UsersPerActivationCounts the number of users indexed by their number of activations and their email address domain. Eg: "1,internal","1,external",etc. UserSignupsPerActivationAndDomainCounts map[string]int }
Counts is type that contains number of MURs and number of UserAccounts per member cluster
func GetCounts ¶
GetCounts returns Counts struct containing number of MURs and number of UserAccounts per member cluster. If the counter is not yet initialized, then it returns error