Changeset 108
- Timestamp:
- 05/18/05 12:39:04 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/toga/toga-functions.php
r107 r108 4 4 include_once "$GANGLIA_PATH/conf.php"; 5 5 include_once "$GANGLIA_PATH/functions.php"; 6 include_once "$GANGLIA_PATH/ganglia.php"; 7 8 global $context; 9 $context = 'cluster'; 10 11 include_once "$GANGLIA_PATH/get_ganglia.php"; 6 12 7 13 if ( !empty( $_GET ) ) { 8 14 extract( $_GET ); 9 15 } 16 17 global $metrics; 18 19 //print_r($metrics); 10 20 11 21 class HTTPVariables { … … 318 328 319 329 function draw() { 330 global $metrics; 331 320 332 $myimg = $this->img; 321 333 … … 332 344 class NodeImage { 333 345 334 var $image, $x, $y ;346 var $image, $x, $y, $hostname; 335 347 336 348 function NodeImage( $image, $x, $y ) { … … 360 372 function setLoad( $load ) { 361 373 $this->load = $load; 374 } 375 376 function setHostname( $hostname ) { 377 $this->hostname = $hostname; 362 378 } 363 379 … … 385 401 function draw() { 386 402 387 $cpus = $metrics[$this->hostname]["cpu_num"][VAL]; 403 global $metrics; 404 405 $cpus = $metrics[$this->hostname][cpu_num][VAL]; 388 406 if (!$cpus) $cpus=1; 389 $load_one = $metrics[$this->hostname][ "load_one"][VAL];407 $load_one = $metrics[$this->hostname][load_one][VAL]; 390 408 $load = ((float) $load_one)/$cpus; 391 409 … … 406 424 $mydatag->parseXML(); 407 425 408 $max_width = 150;426 $max_width = 250; 409 427 $node_width = 12; 410 428 … … 451 469 if( isset( $nodes[$host] ) and ($cur_node <= $nodes_nr) ) { 452 470 $node = new NodeImage( $image, $x, $y ); 471 $node->setHostname( $host ); 453 472 $node->draw(); 454 473 //$nodes[$host]->setCoords( $x, $y );
Note: See TracChangeset
for help on using the changeset viewer.