Changes in src/webapp/webservice/index.php [06c0abb:33c6557]
- File:
-
- 1 edited
-
src/webapp/webservice/index.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/webservice/index.php
r06c0abb r33c6557 16 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 17 */ 18 19 xdebug_start_trace();20 18 21 19 require_once(__DIR__ ."/inc/Config.php"); … … 45 43 46 44 $endTime = floor(time() / $interval) * $interval; 47 $startTime = $endTime - $period;45 $startTime = $endTime - $period; 48 46 $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", $startTime, "--end", $endTime)); 49 47 // $data = rrd_fetch($dbFile, array("AVERAGE", "--resolution", $interval, "--start", "-". $period, "--end", "start+". $period, "--align-start")); … … 68 66 // transform them into json format 69 67 $i = 0; 70 $last Valid= -1;68 $lastTime = -1; 71 69 $keys = array_keys($data); 72 $keyTimeframes = $keys[0]; 73 $itemCount = count($keys); 74 if($itemCount < 0 ){ 70 if(count($keys) < 0 ){ 75 71 error_log("No keys in fetched rrd data from ". $dbFile); 76 72 echo json_encode(""); 77 73 exit; 78 74 } 79 $timeframesCount = count($data[$keyTimeframes]);80 75 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"; 82 77 } 83 78 foreach($data[$keys[0]] as $timeframe => $value){ … … 190 185 } 191 186 192 xdebug_stop_trace();193 194 187 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
