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