# Functions
Add resources returning a new resource with the result A nil resource is considered an empty resource.
AddOnlyExisting adds delta to base resource, ignoring any type not defined in the base resource.
CalculateAbsUsedCapacity returns absolute used as a percentage, a positive integer value, for each defined resource named in the capacity comparing usage to the capacity.
Returns a new resource with the largest value for each quantity in the resources If either resource passed in is nil a zero resource is returned.
ComponentWiseMin returns a new Resource with the smallest value for each quantity in the Resources If either Resource passed in is nil the other Resource is returned If a Resource type is missing from one of the Resource, it is considered empty and the quantity from the other Resource is returned.
ComponentWiseMinOnlyExisting Returns a new Resource with the smallest value for resource type existing only in left but not vice versa.
Calculate share for left of total and right of total.
Calculate share for left of total and right of total separately.
DeepEquals Compare the resources based on resource type existence and its values as well False in case anyone of the resources is nil False in case resource length differs False in case resource type existed in left Resource not exist in right Resource False in case resource type value differs True in case when all resource type and its values of left Resource matches with right Resource.
Equals Compare the resources based on common resource type available in both left and right Resource Resource type available in left Resource but not in right Resource and vice versa is not taken into account False in case anyone of the resources is nil False in case resource type value differs True in case when resource type values of left Resource matches with right Resource if resource type is available.
Compare the resources equal returns the specific values for following cases: left right return nil nil true nil <set> false nil zero res true <set> nil false zero res nil true <set> <set> true/false *based on the individual Quantity values.
No description provided by the author
Get fairness ratio calculated by: highest share for left resource from total divided by highest share for right resource from total.
Check that the whole resource is zero A nil or empty resource is zero (contrary to StrictlyGreaterThanZero).
MergeIfNotPresent Returns a new Resource by merging resource type values present in right with left only if resource type not present in left.
Multiply the resource by the integer ratio returning a new resource.
Multiply the resource by the floating point ratio returning a new resource.
No description provided by the author
Create a new resource from the config map.
No description provided by the author
No description provided by the author
Create a new resource from a string.
NewTrackedResource creates a new instance of TrackedResource.
NewTrackedResourceFromMap creates NewTrackedResource from the given map.
ParseQuantity is used to parse user-provided values into int64 quantities.
ParseVCore is similar to ParseQuantity but allows the 'm' suffix.
Return true if all quantities in larger > smaller Two resources that are equal are not considered strictly larger than each other.
Return true if all quantities in larger > smaller or if the two objects are exactly the same.
Have at least one quantity > 0, and no quantities < 0 A nil resource is not strictly greater than zero.
Subtract resource returning a new resource with the result A nil resource is considered an empty resource This might return negative values for specific quantities.
SubEliminateNegative subtracts resource returning a new resource with the result A nil resource is considered an empty resource This will return 0 values for negative values.
SubErrorNegative subtracts resource returning a new resource with the result.
SubOnlyExisting subtracts delta from base resource, ignoring any type not defined in the base resource.
# Variables
Never update value of Zero.
# Structs
No description provided by the author
TrackedResource is a utility struct to keep track of application resource usage.
# Type aliases
No unit defined here for better performance.