- Timestamp:
- 06/23/05 10:17:37 (18 years ago)
- Location:
- trunk/web/addons/toga
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/toga/conf.php
r129 r163 24 24 // by default localhost's gmetad 25 25 // 26 $DATA_SOURCE = '127.0.0.1:86 49';26 $DATA_SOURCE = '127.0.0.1:8651'; 27 27 28 28 // Is there a jobarchive? -
trunk/web/addons/toga/image.php
r124 r163 10 10 $clustername = $httpvars->getClusterName(); 11 11 12 //printf("clustername = %s\n", $clustername ); 12 13 if( isset($id) && ($id!='')) $filter[id]=$id; 13 14 if( isset($state) && ($state!='')) $filter[state]=$state; … … 23 24 function drawBigClusterImage() { 24 25 25 global $filter ;26 global $filter, $clustername; 26 27 27 28 $ic = new ClusterImage( $clustername ); -
trunk/web/addons/toga/libtoga.php
r152 r163 399 399 var $xmlhandler, $data, $httpvars; 400 400 401 function DataGatherer( ) {401 function DataGatherer( $cluster ) { 402 402 403 403 global $DATA_SOURCE; 404 404 405 //printf("dg cluster = %s\n", $cluster ); 405 406 $ds_fields = explode( ':', $DATA_SOURCE ); 406 407 $ds_ip = $ds_fields[0]; … … 411 412 $this->parser = xml_parser_create(); 412 413 $this->httpvars = $httpvars; 413 $this->xmlhandler = new TorqueXMLHandler( );414 $this->xmlhandler = new TorqueXMLHandler( $cluster ); 414 415 xml_set_element_handler( $this->parser, array( &$this->xmlhandler, 'startElement' ), array( &$this->xmlhandler, 'stopElement' ) ); 415 416 } … … 452 453 class TorqueXMLHandler { 453 454 454 var $clusters, $heartbeat, $nodes, $jobs ;455 456 function TorqueXMLHandler( ) {455 var $clusters, $heartbeat, $nodes, $jobs, $clustername, $proc_cluster; 456 457 function TorqueXMLHandler( $clustername ) { 457 458 $jobs = array(); 458 459 $clusters = array(); 459 $ nodes = array();460 $this->nodes = array(); 460 461 $heartbeat = array(); 462 $this->clustername = $clustername; 463 //printf(" cluster set to %s \n", $this->clustername ); 461 464 } 462 465 … … 489 492 $jobid = null; 490 493 491 // printf( '%s=%s', $attrs[NAME], $attrs[VAL] ); 494 //printf( '%s=%s', $attrs[NAME], $attrs[VAL] ); 495 496 //printf( "clustername = %s proc_cluster = %s\n", $this->clustername, $this->proc_cluster ); 492 497 493 498 if( $name == 'CLUSTER' ) { 494 499 495 $clustername = $attrs[VAL]; 496 497 if( !isset( $clusters[$clustername] ) ) 498 $clusters[$clustername] = array(); 499 500 } else if( $name == 'HOST' ) { 500 $this->proc_cluster = $attrs[NAME]; 501 //printf( "Found cluster %s\n", $attrs[NAME] ); 502 //print_r( $attrs ); 503 504 //if( !isset( $clusters[$clustername] ) ) 505 // $clusters[$clustername] = array(); 506 507 } else if( $name == 'HOST' and $this->proc_cluster == $this->clustername) { 501 508 502 509 $hostname = $attrs[NAME]; 503 510 $location = $attrs[LOCATION]; 511 //printf( "Found node %s\n", $hostname ); 504 512 505 513 if( !isset( $this->nodes[$hostname] ) ) 506 $ this->nodes[$hostname] = new NodeImage( $hostname );507 508 } else if( $name == 'METRIC' and strstr( $attrs[NAME], 'TOGA' ) ) {514 $nodes[$hostname] = new NodeImage( $hostname ); 515 516 } else if( $name == 'METRIC' and strstr( $attrs[NAME], 'TOGA' ) and $this->proc_cluster == $this->clustername ) { 509 517 510 518 if( strstr( $attrs[NAME], 'TOGA-HEARTBEAT' ) ) { … … 576 584 $my_node->addJob( $jobid, 1 ); 577 585 578 $ this->nodes[$host] = $my_node;586 $nodes[$host] = $my_node; 579 587 } 580 588 } … … 582 590 } 583 591 $this->jobs = $jobs; 592 //print_r( $nodes ); 593 $this->nodes = $nodes; 584 594 } 585 595 … … 625 635 626 636 function getNodes() { 637 //print_r( $this->nodes ); 627 638 return $this->nodes; 628 639 } … … 794 805 function ClusterImage( $clustername ) { 795 806 796 $this->dataget = new DataGatherer(); 807 //printf( "image cluster = %s\n", $clustername ); 808 $this->dataget = new DataGatherer( $clustername ); 797 809 $this->clustername = $clustername; 798 810 $this->filters = array(); -
trunk/web/addons/toga/overview.php
r148 r163 5 5 //$tpl->assign("_ROOT.summary", "" ); 6 6 7 $data_gatherer = new DataGatherer( );7 $data_gatherer = new DataGatherer( $clustername ); 8 8 9 9 //$tpl->assign( "self", "./index.php" );
Note: See TracChangeset
for help on using the changeset viewer.