Changes in src/webapp/webservice/index.php [33c6557:6cce084]
- File:
-
- 1 edited
-
src/webapp/webservice/index.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/webservice/index.php
r33c6557 r6cce084 43 43 44 44 $endTime = floor(time() / $interval) * $interval; 45 $startTime = $endTime - $period;45 $startTime = $endTime - $period; 46 46 $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", $startTime, "--end", $endTime)); 47 47 // $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", "-". $period, "--end", "start+". $period, "--align-start")); … … 66 66 // transform them into json format 67 67 $i = 0; 68 $last Time= -1;68 $lastValid = -1; 69 69 $keys = array_keys($data); 70 if(count($keys) < 0 ){ 70 $keyTimeframes = $keys[0]; 71 $itemCount = count($keys); 72 if($itemCount < 0 ){ 71 73 error_log("No keys in fetched rrd data from ". $dbFile); 72 74 echo json_encode(""); 73 75 exit; 74 76 } 77 $timeframesCount = count($data[$keyTimeframes]); 75 78 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"; 77 80 } 78 81 foreach($data[$keys[0]] as $timeframe => $value){
Note:
See TracChangeset
for help on using the changeset viewer.
