13 July 2015

Track your Apex limits in production using Apex Limit Events

Salesforce Apex is the backbone of the programmatic platform. With it you can push the customization of any org beyond the button click realm.

Example of an app you can build with the
Apex Limit Events Pilot
Apex runs in a multitenant environment. The Apex runtime engine strictly enforces limits to ensure that runaway Apex doesn’t monopolize shared resources. If some Apex code ever exceeds a limit, the associated governor issues a run-time exception that cannot be handled. Apex limits are defined in the Salesforce documentation.

I wrote about tracking Apex limits in a blog post last May (That which doesn't limit us makes us stronger). As a force.com developer, you have the ability to instrument your Apex code with System.Limits() methods that allow you to compare how much you're using against the ceiling of what's allowed by any limit.

However, the more instrumentation you add, the more opportunity you have for code and performance issues. It's the Heisenberg concept - that which you try to measure affects the measurement. And even when you do try to track limits in this fashion, the results are stored in developer oriented tools like the Debug Logs or the Force.com Console logs which are really only meant to be used in sandbox. Bu what about DevOps? How can they monitor the health of their developer's code in production?

As a reaction to this, we are introducing the Apex Limit Events pilot program in Summer '15.  The goal of this pilot is to enable operations to monitor their production instances in near real-time and with automated hourly roll-up aggregate metrics that tell you the state and health of your Apex according to their limits.

Each event consists of key information about the Apex execution in the context of a limit including:
  • EntryPointId
  • EntryPointName
  • EntryPointType
  • EventTime
  • ExecutionIdentifier
  • Id
  • LimitType
  • LimitValue
  • NamespacePrefix
  • UserId
  • Username
Each hourly metric consists of key aggregate information including:
  • Distinct Number of Apex Transactions
  • Distinct Number of Apex Transactions With Limits Exceeding 60% Threshold
  • Distinct Number of Apex Transactions With Limits Exceeding 60% Threshold By Entry Point Name
  • Distinct Number of Apex Transactions With Limits Exceeding 60% Threshold By Limit Type
  • Average Limit Value By Entry Point Name
  • Average Limit Value By Limit Type
Apex limit events is accessible via the Salesforce public API through the apexlimitevent sobject. The only user interface is an org preference in setup that an administrator can control to enable or disable the feature within their org.

To help developers and operations bootstrap their efforts to take advantage of this feature, I built a Github repo including a:

1. Visualforce page and tab integrating Apex limit events with the Google Charting API
2. LimitsTest Apex class that exposes a REST API webservice you can use to intentionally exceed limits and load data into the apexlimitevents sobject
3. ApexLimitJob Apex class that can be used with scheduled Apex to generate limits
4. limitsHammer python code that makes it easy to generate limits data

To participate in the pilot, contact salesforce support or your account executive. For more information about the pilot, check out the tip sheet.

38 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete
  3. Concrete carports are sturdy and dependable, and whenever kept up well can suffer up to thirty strong years.Chape Braspenning: Chape voor Nieuwbouw of Renovatie

    ReplyDelete
  4. Client preparing - Provide your clients with virtual occasion instructional courses, so they realize how to get the best from your administration and to keep them educated about any changes. stage hire Yorkshire

    ReplyDelete
  5. I'm no longer sure where you're getting your information, however good topic. I must spend a while finding out much more or understanding more. Thanks for magnificent info I used to be in search of this information for my mission. webstagram

    ReplyDelete
    Replies
    1. Great Article
      Cyber Security Projects

      projects for cse

      Networking Security Projects

      JavaScript Training in Chennai

      JavaScript Training in Chennai

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  6. So in light of all that, I state "Cheerful Christmas" with no dread that I am disrespecting God. Vinny Guadagnino Net Worth

    ReplyDelete
  7. We make good on regulatory expenses to governments that all likely use some portion of those assets for things that Christians can't help contradicting and that the Bible instructs against.Mladen Solomun Net Worth

    ReplyDelete
  8. I have tested a few and the best hackers for hire on the dark web are the guys at dark web hackers, download Torbrowser and then go to this dark
    web site with Torbrowser:
    http://ziagmjbpt47drkrk.onion/

    ReplyDelete
  9. I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post  forro festival

    ReplyDelete
  10. Great post, and great website. Thanks for the information! https://smartlogg.se

    ReplyDelete
  11. I am jovial you take pride in what you write. It makes you stand way out from many other writers that can not push high-quality content like you. produktvideo erstellen lassen

    ReplyDelete
  12. Skipping the film festival circuit works for many independent movie producers that don't have name actors in their film or know their story won't appeal to an art house crowd.
    123 movies

    ReplyDelete
  13. What I've learned the hard way is the movie distribution really starts with promoting and marketing a movie.

    f movies

    ReplyDelete
  14. Appropriately fixed and cleaned, it is one of the most ecologically economical ground surface alternatives accessible - and one of the most adaptable.Chape

    ReplyDelete
  15. The characters in this movie were not able to trust anyone around them, and they lacked the resources necessary to carry on a normal life, which could be an accurate outcome in a real societal breakdown.123movies

    ReplyDelete
  16. It has become one of the greatest platforms for music promotion and lets people interact with others, along with sharing music tracks and spreading good music around the world. Buy soundcloud plays

    ReplyDelete
  17. Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. erklärvideo erstellen

    ReplyDelete
  18. In my mind, Tropic Thunder is the exception to an ever increasing rule we see with movie comedies: that the formula for mainstream comic success is to have just enough funny scenes to keep the audience entertained even if the rest of the film is shit.123movie

    ReplyDelete
  19. So yes - a film can have a high return, but an investor can lose it all.

    0123movies

    ReplyDelete
  20. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work Find trusted hackers for hire online

    ReplyDelete
  21. It has an amazingly unified theme-driven story.123 movies

    ReplyDelete
  22. I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. salesforce

    ReplyDelete
  23. You simply need to realize what to search for while picking a global vehicle delivering organization. track china post to uk

    ReplyDelete
  24. Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. Find my phone location by number

    ReplyDelete
  25. Food I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article...

    ReplyDelete
  26. It’s great to come across a blog. we provide audio hire Melbourne at affordable prices. for more info visit our website.

    ReplyDelete
  27. I am impressed. I don't think Ive met anyone who knows as much about this subject as you do. You are truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog you have got here. hire a computer hacker

    ReplyDelete
  28. Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! Hire a professional phone hacker

    ReplyDelete
  29. Amazing post with quality information! Many wonder, how to recover stolen or scammed Bitcoin? Hire a bitcoin recovery expert online

    ReplyDelete
  30. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Pinoy Tambayan

    ReplyDelete
  31. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info.
    event

    ReplyDelete
  32. I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. Gold Coast Concrete Resurfacing

    ReplyDelete