Changeset 145 for trunk/web/addons/toga/libtoga.php
- Timestamp:
- 06/17/05 17:14:55 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/toga/libtoga.php
r143 r145 2 2 // If php is compiled without globals 3 3 // 4 if ( !empty( $_GET ) ) {5 extract( $_GET );6 }4 //if ( !empty( $_GET ) ) { 5 // extract( $_GET ); 6 //} 7 7 8 8 class HTTPVariables { … … 60 60 chdir( $GANGLIA_PATH ); 61 61 62 $context = 'cluster';63 64 62 include_once "./conf.php"; 65 63 include_once "./functions.php"; 66 64 include_once "./ganglia.php"; 67 //include_once "./get_context.php"; 65 include_once "./get_context.php"; 66 unset( $start ); 67 $context = 'cluster'; 68 68 include_once "./get_ganglia.php"; 69 69 … … 229 229 var $rrdbin, $rrdvalues, $clustername, $hostname, $tempdir, $tarchdir, $metrics; 230 230 231 function TarchRrd( $clustername, $rrdbin = '/usr/bin/rrdtool', $tarchdir = '/data/toga/rrds' ) { 231 function TarchRrdGraph( $clustername, $hostname, $rrdbin = '/usr/bin/rrdtool', $tarchdir = '/data/toga/rrds' ) { 232 232 233 $this->rrdbin = $rrdbin; 233 234 $this->rrdvalues = array(); 234 235 $this->tarchdir = $tarchdir; 236 $this->clustername = $clustername; 237 $this->hostname = $hostname; 235 238 } 236 239 … … 274 277 function getTimePeriods( $start, $end ) { 275 278 279 //printf("start = %s end = %s\n", $start, $end ); 276 280 $times = array(); 277 281 $dirlist = $this->dirList( $this->tarchdir . '/' . $this->clustername . '/' . $this->hostname ); 282 283 //print_r( $dirlist ); 284 278 285 $first = 0; 279 286 $last = 9999999999999; … … 287 294 } 288 295 296 //printf( "first = %s last = %s\n", $first, $last ); 297 289 298 foreach( $dirlist as $dir ) { 290 299 291 if( $dir >= $first and $dir <= $last and !array_key_exists( $dir, $times ) ) 300 //printf( "dir %s ", $dir ); 301 302 if( $dir >= $first and $dir <= $last and !array_key_exists( $dir, $times ) ) { 303 292 304 $times[] = $dir; 293 } 305 //printf("newtime %s ", $dir ); 306 307 } 308 } 309 310 //print_r( $times ); 294 311 295 312 sort( $times ); 296 313 314 //print_r( $times ); 315 297 316 return $times; 317 } 318 319 function getRrdDirs( $start, $stop ) { 320 321 //printf( "tarchdir = %s\n", $this->tarchdir ); 322 $timess = $this->getTimePeriods( $start, $stop ); 323 //print_r( $timess ); 324 325 $rrd_files = array(); 326 327 foreach( $timess as $time ) { 328 329 $rrd_files[] = $this->tarchdir . '/' . $this->clustername . '/' . $this->hostname. '/'.$time; 330 } 331 332 return $rrd_files; 333 } 334 335 function getRrdFiles( $metric, $start, $stop ) { 336 337 $times = $this->getTimePeriods( $start, $stop ); 338 339 $rrd_files = array(); 340 341 foreach( $times as $time ) { 342 343 $rrd_files[] = $this->tarchdir . '/' . $this->clustername . '/' . $this->hostname . '/' .$time. '/' . $metric. '.rrd'; 344 } 345 346 return $rrd_files; 298 347 } 299 348 … … 309 358 310 359 //return $graph; 360 return 0; 311 361 } 312 362 }
Note: See TracChangeset
for help on using the changeset viewer.