- Timestamp:
- 05/20/05 09:48:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/toga/toga-functions.php
r108 r109 6 6 include_once "$GANGLIA_PATH/ganglia.php"; 7 7 8 // Set cluster context so that Ganglia will 9 // provide us with the correct metrics array 10 // 8 11 global $context; 9 12 $context = 'cluster'; … … 11 14 include_once "$GANGLIA_PATH/get_ganglia.php"; 12 15 16 // If php is compiled without globals 17 // 13 18 if ( !empty( $_GET ) ) { 14 19 extract( $_GET ); 15 20 } 16 21 22 // Ganglia's array of host metrics 23 // 17 24 global $metrics; 18 25 … … 361 368 function colorHex( $color ) { 362 369 363 $my_color = imageColorAllocate( $this->image, hexdec( substr( $color, 0, 2 )), hexdec( substr( $color, 2, 4 )), hexdec( substr( $color, 4, 6)) );370 $my_color = imageColorAllocate( $this->image, hexdec( substr( $color, 0, 2 )), hexdec( substr( $color, 2, 2 )), hexdec( substr( $color, 4, 2 )) ); 364 371 365 372 return $my_color; … … 392 399 $my_loadcolor = $this->colorHex( load_color($load) ); 393 400 394 imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+1 2, $this->y+12, $queuecolor );395 imageFilledRectangle( $this->image, $this->x+ 2, $this->y+2, $this->x+10, $this->y+10, $my_loadcolor );401 imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+11, $this->y+11, $queuecolor ); 402 imageFilledRectangle( $this->image, $this->x+1, $this->y+1, $this->x+10, $this->y+10, $my_loadcolor ); 396 403 397 404 // Een job markering? … … 407 414 $load_one = $metrics[$this->hostname][load_one][VAL]; 408 415 $load = ((float) $load_one)/$cpus; 416 //printf( "hostname %s cpus %s load_one %s load %f\n", $this->hostname, $cpus, $load_one, $load ); 409 417 410 418 $this->drawNode( $load ); … … 425 433 426 434 $max_width = 250; 427 $node_width = 1 2;435 $node_width = 11; 428 436 429 437 $nodes = $mydatag->getNodes(); … … 453 461 454 462 //printf( "imagecreate: %dx%d", ($nodes_per_row*$node_width), ($node_rows*$node_width) ); 455 $image = imageCreateTrueColor( ($nodes_per_row*$node_width) , ($node_rows*$node_width));463 $image = imageCreateTrueColor( ($nodes_per_row*$node_width)+1, ($node_rows*$node_width)+1 ); 456 464 $colorwhite = imageColorAllocate( $image, 255, 255, 255 ); 457 465 imageFill( $image, 0, 0, $colorwhite ); … … 464 472 $y = ($n * $node_width); 465 473 466 $cur_node = ($n * $nodes_per_row) + ($m + 1);474 $cur_node = ($n * $nodes_per_row) + ($m); 467 475 $host = $node_keys[$cur_node]; 468 476 469 if( isset( $nodes[$host] ) and ($cur_node <= $nodes_nr) ) { 477 //printf( "host %s curnode %s ", $host, $cur_node ); 478 479 if( isset( $nodes[$host] ) and ($cur_node < $nodes_nr) ) { 480 //printf( "image %s\n", $host ); 470 481 $node = new NodeImage( $image, $x, $y ); 471 482 $node->setHostname( $host );
Note: See TracChangeset
for help on using the changeset viewer.