We have been running on Salesforce platform for just over 6 months with considerate amount of customizations. The data volume has been growing and features have been added into existing codebase overtime. We would like to have good way to monitor the performance of our customization code including apex, batch job, web service. (I will post another question on monitoring Visualforce page from user's perspective. This question focus on monitoring backend process.) What are the best process doing so? Here is my take with some questions:
- SF debug logging is not ideal since it doesn't persist and no API to access that info.
- We can create custom object to record information. It's good for those none-frequent process, but not ideal for frequent process because of database hit.
- Custom settings are cached and the performance penalty is small. It has data storage size limitation.
Based on the above 3 facts, I'd like to explore some options:
- Can we use custom setting for logging? We can take advantage of its low latency of write if writing is memory operation; and avoid the size limitation by moving the data into custom object periodically in batch mode and free the space. Does this sound?
- What are other options for logging performance data without much overhead?
Thanks! Lin
finish()
- one DML statement so low overhead. The log record contains a formatted string and optionally, numerical stats of interesting things that happen during the batch job. Everything done with utility classes and interfaces for consistent approach across batch classes – cropredy Aug 28 '15 at 19:54