Changeset 522 for trunk/web/addons


Ignore:
Timestamp:
03/13/08 17:01:07 (16 years ago)
Author:
bastiaans
Message:

job_monarch/libtoga.php,
job_monarch/conf.php:

Location:
trunk/web/addons/job_monarch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/web/addons/job_monarch/conf.php

    r515 r522  
    22// Show hosts in a jobview by default?
    33//
    4 $default_showhosts = 1;
     4$default_showhosts = true;
    55
    66// Stop displaying archive search results after SEARCH_RESULT_LIMIT
     
    1010// Show the column job attribute 'requested memory'?
    1111//
    12 $COLUMN_REQUESTED_MEMORY = 0;
     12$COLUMN_REQUESTED_MEMORY = false;
    1313
    1414// Show the column job attribute 'queued' (since)?
    1515//
    16 $COLUMN_QUEUED = 1;
     16$COLUMN_QUEUED = true;
    1717
    1818// Show the column job attribute 'nodes' hostnames?
    1919//
    20 $COLUMN_NODES = 1;
     20$COLUMN_NODES = true;
    2121
    2222// Path to Ganglia's web frontend root
    2323//
    24 //$GANGLIA_PATH = "/var/www/test-ganglia";
    25 $GANGLIA_PATH = "../..";
     24$GANGLIA_PATH = "/var/www/test-ganglia";
     25//$GANGLIA_PATH = "../..";
    2626
    2727// Format of how to display a date and time in human readable format
     
    6363$NODE_OFFLINE_MARKING = ".";
    6464
     65// Show empty columns in the ClusterImage?
     66//
     67$SHOW_EMPTY_COLUMN = false;
     68
     69// Show empty rows in the ClusterImage?
     70//
     71$SHOW_EMPTY_ROW = true;
     72
    6573// XML Datasource for Job Monarch
    6674// by default localhost's gmetad
     
    7179// Is there a jobarchive?
    7280//
    73 $JOB_ARCHIVE = 1;
     81$JOB_ARCHIVE = true;
    7482
    7583// Path to the job archive rrd files
     
    92100//$CLUSTER_CONFS["Example Cluster"]     = "./clusterconf/example.php";
    93101//
    94 //$CLUSTER_CONFS["LISA Cluster"]          = "./clusterconf/lisa-example.php";
    95 //$CLUSTER_CONFS["GINA Cluster"]          = "./clusterconf/gina-example.php";
     102$CLUSTER_CONFS["LISA Cluster"]          = "./clusterconf/lisa-example.php";
     103$CLUSTER_CONFS["GINA Cluster"]          = "./clusterconf/gina-example.php";
    96104?>
  • trunk/web/addons/job_monarch/libtoga.php

    r519 r522  
    10971097                $this->tasks = $this->tasks + $cpus;
    10981098        }
    1099 
    11001099        function setDown( $down )
    11011100        {
    11021101                $this->down = $down;
    11031102        }
    1104 
    11051103        function isDown()
    11061104        {
     
    11111109                $this->offline = $offline;
    11121110        }
    1113 
    11141111        function isOffline()
    11151112        {
    11161113                return $this->offline;
    11171114        }
    1118 
    11191115        function setImage( $image )
    11201116        {
    11211117                $this->image = $image;
    11221118        }
    1123 
    11241119        function setCoords( $x, $y )
    11251120        {
    11261121                $this->x = $x;
    11271122                $this->y = $y;
     1123        }
     1124        function getX()
     1125        {
     1126                return $this->x;
     1127        }
     1128        function getY()
     1129        {
     1130                return $this->y;
    11281131        }
    11291132
     
    13841387                global $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH;
    13851388                global $BIG_CLUSTERIMAGE_MAXWIDTH, $BIG_CLUSTERIMAGE_NODEWIDTH;
    1386                 global $CLUSTER_CONFS, $confcluster;
     1389                global $CLUSTER_CONFS, $confcluster, $SHOW_EMPTY_COLUMN, $SHOW_EMPTY_ROW;
    13871390
    13881391                global $SORTBY_HOSTNAME, $SORT_ORDER, $skan_str;
     
    14551458                if( $SORTBY_HOSTNAME != "" )
    14561459                {
    1457 
    14581460                        $sorted         = array();
    14591461
     
    14941496                        if(( strpos( $SORTBY_HOSTNAME, $x_str ) < strpos( $SORTBY_HOSTNAME, $y_str ) ) && ( $x_present && $y_present ))
    14951497                        {
    1496                        
    14971498                                $x_first        = 1;
    14981499                        }
     
    15311532                        $y_min          = null;
    15321533                        $y_max          = null;
     1534
     1535                        $x_columns      = array();
     1536                        $y_rows         = array();
    15331537
    15341538                        // Now let's walk through all our nodes and see which one are valid for our scan pattern
     
    16311635                                        $y_max  = $y;
    16321636                                }
     1637
     1638                                // Store which non-empty columns and rows we found
     1639                                //
     1640                                if( !in_array( $x, $x_columns ) )
     1641                                {
     1642                                        $x_columns[] = $x;
     1643                                }
     1644                                if( !in_array( $y, $y_rows ) )
     1645                                {
     1646                                        $y_rows[] = $y;
     1647                                }
    16331648                        }
    16341649
     
    16371652                        //
    16381653                        $sorted_nodes   = usort( $nodes, "cmp" );
     1654
     1655                        //print_r( $x_columns ) ;
    16391656
    16401657                        $cur_node       = 0;
     
    16541671                        if( $this->isBig() )
    16551672                        {
    1656 
    16571673                                $y_offset       = ($fontheight * (1 + strlen( $x_max) ) ) + ((2 + strlen( $x_max)) * $fontspaceing);
    16581674                                $x_offset       = ($fontwidth * (1 + strlen( $y_max) ) ) + ((2 + strlen( $y_max)) * $fontspaceing);
    1659 
    16601675                        }
    16611676
     
    17111726                        }
    17121727
     1728                        $previous_n     = 0;
     1729                        $previous_m     = 0;
     1730                        $x_empty_count  = 0;
     1731                        $y_empty_count  = 0;
     1732
     1733                        // Let's start assigning x,y coordinates now
     1734                        //
    17131735                        for( $n = $x_min; $n <= $x_max; $n++ )
    17141736                        {
    17151737                                for( $m = $y_min; $m <= $y_max; $m++ )
    17161738                                {
    1717 
    17181739                                        if( $x_min > 0 )
    17191740                                        {
    1720                                                 $x      = $x_offset + ( ($n-$x_min) * $node_width );
     1741                                                $x      = $x_offset + ( ($n-$x_min) * $node_width ) - ($x_empty_count * $node_width);
    17211742                                        }
    17221743                                        if( $y_min > 0 )
    17231744                                        {
    1724                                                 $y      = $y_offset + ( ($m-$y_min) * $node_width );
     1745                                                $y      = $y_offset + ( ($m-$y_min) * $node_width ) - ($y_empty_count * $node_width);
     1746                                        }
     1747
     1748                                        // Don't show empty rows/columns if option enabled
     1749                                        //
     1750                                        if( !in_array( $n, $x_columns ) && !$SHOW_EMPTY_COLUMN )
     1751                                        {
     1752                                                // Skip to next iteration: we don't want a empty column
     1753                                                //
     1754                                                if( $n > $previous_n )
     1755                                                {
     1756                                                        $previous_n = $n;
     1757                                                        $x_empty_count++;
     1758                                                }
     1759                                                continue;
     1760                                        }
     1761                                        if( !in_array( $m, $y_rows ) && !$SHOW_EMPTY_ROW )
     1762
     1763                                        {
     1764                                                // Skip to next iteration: we don't want a empty column
     1765                                                //
     1766                                                if( $m > $previous_m )
     1767                                                {
     1768                                                        $previous_m = $m;
     1769                                                        $y_empty_count++;
     1770                                                }
     1771                                                continue;
    17251772                                        }
    17261773
Note: See TracChangeset for help on using the changeset viewer.