A nightly Apex job at an airline recalculates loyalty points and runs several queries and DML statements per transaction. Before running another query, the code must check how many SOQL queries the current transaction has already consumed. Which Apex class exposes this information?
- System.Governor, which returns current usage for every governor limit in the org
- OrgLimits, which returns org-wide allocations such as daily API requests and storage
- Limits, which offers static methods such as getQueries() and getLimitQueries() for the current transaction
- AsyncLimits, which tracks limit usage only for Batch Apex and Queueable jobs
Show answer
Answer: C
Why: The Limits class reports governor limit consumption for the current execution context. Methods like getQueries() return what has been used, and getLimitQueries() returns the maximum allowed, so code can react before a limit is exceeded.