function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ScottGScottG 

Pinging Salesforce - Best Practice

I'm working on a site ops tool that will allow a user to ping Salesforce to ensure that the API is alive. Is there a recommended approach in doing this?

Thanks in advance!

darozdaroz
Having done a fair bit on monitoring work... Let me start with a request...

... if you're already using the API at regular intervals make your monitoring part of that process instead of adding load on the servers.

That said, my monitoring consists of several approaches:

1. Active monitoring (setup - query - teardown) times for each (and every) API call I make. It's part of my wrapper around the SOAP calls.
2. I monitor na1, and na1-api for API calls.
3. Using my proxy server all NA1 UI responses are also tracked for time to generate the page.

In addition the first 2 are done in a redundant fasion -- they run on hosts geographically diverse as well as network-diverse.

If you're not using the API regularly (I do thousands upon thousands of calls a day, on average one every few seconds) you can make a fairly lightweight call to the API to get it's current timestamp. You'll have to check the API docs for the exact call -- I don't use it often enough to remember it.
DevAngelDevAngel
You can use the getServerTimestamp assuming you have a process running that wakes up at intervals and can handle session timeouts.