Capture OrgLimits data on Log__c
Currently, the LogEntry__c object has multiple fields related to tracking transactional limits, using the class System.Limits. I think it'd be helpful to capture and store organizational limits on Log__c, using the class System.OrgLimits.
This data would probably need to be stored in a long text-area field (as JSON) and displayed using a custom component - the values returned by OrgLimits can be drastically different between orgs, based on the orgs licenses & add-ons, so it's not feasible to have a predefined number of fields on Log__c. This means that things like standard reports & dashboards probably can't be used to view this data, but using a custom component would at least provide admins/devs with a way to see the information.
Love this idea! Something to be aware of from my own usage of OrgLimits within Apex Rollup - calling getMap() fails during synchronous test runs (so, during packaging...) which means a nice little stub will be helpful to get around that particular platform idiosyncrasy 😅
@jamessimone that's great to know, because that sounds... terribly frustrating 😅 I'm trying to think of a rational explanation for why the OrgLimits would work that way, but I'm guessing there's not a very satisfying answer. Sounds like a stub will definitely be needed!
Haha yeah. Here're the relevant lines in the codebase and the test that uses the stub!
This is now available in release v4.13.2 🎉