Changeset 516
- Timestamp:
- 03/08/08 21:32:55 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/overview.php
r512 r516 581 581 $rjqj_host = null; 582 582 583 $nodes_down = null; 584 $nodes_offline = null; 585 586 $replacestr = array(); 587 $replacestr[] = "'"; 588 $replacestr[] = " "; 589 583 $na_nodes = 0; 584 $na_cpus = 0; 585 590 586 foreach( $metrics as $bhost => $bmetric ) 591 587 { … … 596 592 $rjqj_host = $bhost; 597 593 } 598 if( ( $mname == 'MONARCH-DOWN' ) )599 {600 $nodes_down = str_replace($replacestr,NULL,split(',',substr($mval['VAL'],1,-1)));601 }602 if( ( $mname == 'MONARCH-OFFLINE' ) )603 {604 $nodes_offline = str_replace($replacestr,NULL,split(',',substr($mval['VAL'],1,-1)));605 }606 594 } 607 595 } 608 596 609 $nodes_counted = array(); 610 611 if($nodes_down != NULL || $nodes_offline!=NULL ) 612 { 613 foreach( $metrics as $bh => $bm ) 597 foreach( $gnodes as $ghost => $gnode ) 598 { 599 if( $gnode->isDown() || $gnode->isOffline() ) 614 600 { 615 if (in_array($bh,$nodes_offline) && $gnodes[$bh]) 616 { 617 $nodes_counted[] = $bh; 618 if(! $gnodes[$bh]->getJobs()) 619 { 620 $na_cpus += ($bm['cpu_num'][VAL]); 621 $na_nodes += 1; 622 } 623 } 624 if (in_array($bh,$nodes_down) && !in_array($bh,$nodes_counted) && $gnodes[$bh]) 625 { 626 $nodes_counted[] = $bh; 627 if(! $gnodes[$bh]->getJobs()) 628 { 629 $na_cpus += ($bm['cpu_num'][VAL]); 630 $na_nodes += 1; 631 } 632 } 601 $na_nodes += 1; 602 $na_cpus += $metrics[$ghost]['cpu_num']['VAL']; 633 603 } 634 604 } 635 605 636 606 // Running / queued amount jobs graph 637 607 //
Note: See TracChangeset
for help on using the changeset viewer.