Ignore:
File:
1 edited

Legend:

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

    r33c6557 r6cce084  
    4343
    4444        $endTime = floor(time() / $interval) * $interval;
    45         $startTime = $endTime - $period;
     45        $startTime = $endTime - $period;
    4646        $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", $startTime, "--end", $endTime));
    4747        // $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", "-". $period, "--end", "start+". $period, "--align-start"));
    … …  
    6666        // transform them into json format
    6767        $i = 0;
    68         $lastTime = -1;
     68        $lastValid = -1;
    6969        $keys = array_keys($data);
    70         if(count($keys) < 0 ){
     70        $keyTimeframes = $keys[0];
     71        $itemCount = count($keys);
     72        if($itemCount < 0 ){
    7173                error_log("No keys in fetched rrd data from ". $dbFile);
    7274                echo json_encode("");
    7375                exit;
    7476        }
     77        $timeframesCount = count($data[$keyTimeframes]);
    7578        if($debug > 0){
    76                 echo "<p>Variables: ". count($keys) ."; Timeframes: ". count($data[$keys[0]]) ."</p>\n";
     79                echo "<p>Variables: ". $itemCount ."; Timeframes: ". $timeframesCount ."</p>\n";
    7780        }
    7881        foreach($data[$keys[0]] as $timeframe => $value){
Note: See TracChangeset for help on using the changeset viewer.