PHP Cron Push Monitoring

I run a cron job every 5 minutes to execute background processes. Once they have successfully completed, I execute the following PHP function to verify their success and measure the execution time. If the execution fails, it sends me a push notification indicating that the push/heartbeat was not received within the expected timeframe. I monitor the push timeframes on

Configuration for my 5-minute (300-second) check.


Execution and monitoring of execution time using StatusCake Push (Heartbeat).

If you’d like to use the code and function, don’t forget to update the PK and TestID with your values.

function sendStatusCakeGETRequest() {
    // URL and parameters
    $url = '' . round((microtime(true) - $_SERVER["REQUEST_TIME_FLOAT"])*1000,0);

    // Initialize cURL session
    $ch = curl_init();

    // Set cURL options
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    // Execute the cURL session
    $response = curl_exec($ch);

    // Check for cURL errors
    if (curl_errno($ch)) {
        echo 'cURL error: ' . curl_error($ch);

    // Close cURL session

    // Output the response
    echo 'Response from StatusCake: ' . $response;


The `time` parameter is optional, and defaults to 0. The value is interpreted in milliseconds. (1000ms = 1 second)

These are the results with everything set up.