UTIL_Limits.LimitCheck
Class
global class UTIL_Limits.LimitCheckFluent limit inspector scoped to a single governor limit type. Provides methods to check remaining budget, usage percentage, exhaustion, and threshold proximity.
Since: 1.0
Fields
| Field | Description |
|---|---|
| global final String label | The human-readable label for this limit type (e.g. |
Methods
| Method | Description |
|---|---|
| global Boolean isExhausted() | Returns whether the limit has been fully consumed (no remaining budget). |
| global Boolean isNearLimit(Decimal threshold) | Returns whether usage has reached or exceeded the given threshold. |
| global Integer maximum() | Returns the maximum allowed units for this limit type. |
| global Decimal percentUsed() | Returns the percentage of the limit consumed as a value between 0.0 and 1.0. |
| global Integer remaining() | Returns the number of limit units remaining before the governor limit is hit. |
| global Integer used() | Returns the number of limit units consumed in this transaction. |
Method Details
isExhausted
global Boolean isExhausted()Returns whether the limit has been fully consumed (no remaining budget).
Returns: Boolean - True when remaining() is less than or equal to zero
Since: 1.0
isNearLimit
global Boolean isNearLimit(Decimal threshold)Returns whether usage has reached or exceeded the given threshold. Values greater than 1.0 are automatically normalised by dividing by 100 (e.g. 80 becomes 0.8).
Parameters:
threshold(Decimal) - The threshold as a decimal (0.0–1.0) or percentage (e.g. 80 for 80%)
Returns: Boolean - True when percentUsed() is at or above the normalised threshold
Since: 1.0
maximum
global Integer maximum()Returns the maximum allowed units for this limit type.
Returns: Integer - Governor limit maximum
Since: 1.0
percentUsed
global Decimal percentUsed()Returns the percentage of the limit consumed as a value between 0.0 and 1.0.
Returns: Decimal - Usage percentage (0.0 = none used, 1.0 = fully exhausted)
Since: 1.0
remaining
global Integer remaining()Returns the number of limit units remaining before the governor limit is hit.
Returns: Integer - Remaining budget (maximum - used)
Since: 1.0
used
global Integer used()Returns the number of limit units consumed in this transaction.
Returns: Integer - Current usage count
Since: 1.0
Field Details
label
global final String labelType: String
The human-readable label for this limit type (e.g. "Callouts", "Queries").