HeadTalker / uptime-robot

:chart_with_upwards_trend: One Pager To Monitor Uptime With The Uptime Robot API
GNU General Public License v2.0
78 stars 18 forks source link

issues with some graphs #1

Closed mritzmann closed 8 years ago

mritzmann commented 8 years ago
Warning: array_reverse() expects parameter 1 to be array, null given in /home/httpd/vhosts/status.markus-mail.com/status.markus-mail.com/main/index.php on line 214

Some graphs her has problems: http://status.markus-mail.com/

Assumption: trouble with monitor type HTTP(s)?

HeadTalker commented 8 years ago

Thanks digging into it now

HeadTalker commented 8 years ago

@mritzmann Do you mind printing out some info? My HTTP(s) monitors are working however when I create new monitors that do not have data I get an error.

/main/index.php

                curl_setopt_array($curl, [
                  CURLOPT_RETURNTRANSFER => true,
                  CURLOPT_URL            => $endpoint,
                ]);
                $response = curl_exec($curl);
                $decoderesponse = json_decode($response, true);

                echo "<pre>";
                print_r(json_decode($response, 1));
                echo "</pre>";

This will print out a response. I am wondering whether the monitors with errors have response times [responsetime] .

HeadTalker commented 8 years ago

I think this should be fixed now. I added some fallback incase there is not enough data to plot.

https://github.com/HeadTalker/uptime-robot/commit/25de59af3e6226b73358bb0c2ab49bdc5c4337dc

Try updating and see. It should be fixed :+1:

HeadTalker commented 8 years ago

I can confirm after inspecting element the arrays were empty since there was no data to process on those last graphs.

It looks like this

                  var response_datetime = [];
                  var response_value = [];

When it should look like once there is data

                  var response_datetime = ["12\/08\/2015 17:05:48","12\/08\/2015 19:05:48","12\/08\/2015 20:56:55","12\/08\/2015 21:59:05"];
                  var response_value = ["266","265","266","250"];

So now there is some fallback incase this happens.

mritzmann commented 8 years ago

Thank you for your work! :+1: