Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webservice/index.php

    r06c0abb r33c6557  
    1616    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1717*/
    18 
    19 xdebug_start_trace();
    2018
    2119require_once(__DIR__ ."/inc/Config.php");
    … …  
    4543
    4644        $endTime = floor(time() / $interval) * $interval;
    47         $startTime = $endTime - $period;
     45        $startTime = $endTime - $period;
    4846        $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", $startTime, "--end", $endTime));
    4947        // $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", "-". $period, "--end", "start+". $period, "--align-start"));
    … …  
    6866        // transform them into json format
    6967        $i = 0;
    70         $lastValid = -1;
     68        $lastTime = -1;
    7169        $keys = array_keys($data);
    72         $keyTimeframes = $keys[0];
    73         $itemCount = count($keys);
    74         if($itemCount < 0 ){
     70        if(count($keys) < 0 ){
    7571                error_log("No keys in fetched rrd data from ". $dbFile);
    7672                echo json_encode("");
    7773                exit;
    7874        }
    79         $timeframesCount = count($data[$keyTimeframes]);
    8075        if($debug > 0){
    81                 echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
     76                echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n";
    8277        }
    8378        foreach($data[$keys[0]] as $timeframe => $value){
    … …  
    190185}
    191186
    192 xdebug_stop_trace();
    193 
    194187?>
Note: See TracChangeset for help on using the changeset viewer.