- Timestamp:
- 03/13/08 17:01:07 (16 years ago)
- Location:
- trunk/web/addons/job_monarch
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/conf.php
r515 r522 2 2 // Show hosts in a jobview by default? 3 3 // 4 $default_showhosts = 1;4 $default_showhosts = true; 5 5 6 6 // Stop displaying archive search results after SEARCH_RESULT_LIMIT … … 10 10 // Show the column job attribute 'requested memory'? 11 11 // 12 $COLUMN_REQUESTED_MEMORY = 0;12 $COLUMN_REQUESTED_MEMORY = false; 13 13 14 14 // Show the column job attribute 'queued' (since)? 15 15 // 16 $COLUMN_QUEUED = 1;16 $COLUMN_QUEUED = true; 17 17 18 18 // Show the column job attribute 'nodes' hostnames? 19 19 // 20 $COLUMN_NODES = 1;20 $COLUMN_NODES = true; 21 21 22 22 // Path to Ganglia's web frontend root 23 23 // 24 //$GANGLIA_PATH = "/var/www/test-ganglia";25 $GANGLIA_PATH = "../..";24 $GANGLIA_PATH = "/var/www/test-ganglia"; 25 //$GANGLIA_PATH = "../.."; 26 26 27 27 // Format of how to display a date and time in human readable format … … 63 63 $NODE_OFFLINE_MARKING = "."; 64 64 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 65 73 // XML Datasource for Job Monarch 66 74 // by default localhost's gmetad … … 71 79 // Is there a jobarchive? 72 80 // 73 $JOB_ARCHIVE = 1;81 $JOB_ARCHIVE = true; 74 82 75 83 // Path to the job archive rrd files … … 92 100 //$CLUSTER_CONFS["Example Cluster"] = "./clusterconf/example.php"; 93 101 // 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"; 96 104 ?> -
trunk/web/addons/job_monarch/libtoga.php
r519 r522 1097 1097 $this->tasks = $this->tasks + $cpus; 1098 1098 } 1099 1100 1099 function setDown( $down ) 1101 1100 { 1102 1101 $this->down = $down; 1103 1102 } 1104 1105 1103 function isDown() 1106 1104 { … … 1111 1109 $this->offline = $offline; 1112 1110 } 1113 1114 1111 function isOffline() 1115 1112 { 1116 1113 return $this->offline; 1117 1114 } 1118 1119 1115 function setImage( $image ) 1120 1116 { 1121 1117 $this->image = $image; 1122 1118 } 1123 1124 1119 function setCoords( $x, $y ) 1125 1120 { 1126 1121 $this->x = $x; 1127 1122 $this->y = $y; 1123 } 1124 function getX() 1125 { 1126 return $this->x; 1127 } 1128 function getY() 1129 { 1130 return $this->y; 1128 1131 } 1129 1132 … … 1384 1387 global $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH; 1385 1388 global $BIG_CLUSTERIMAGE_MAXWIDTH, $BIG_CLUSTERIMAGE_NODEWIDTH; 1386 global $CLUSTER_CONFS, $confcluster ;1389 global $CLUSTER_CONFS, $confcluster, $SHOW_EMPTY_COLUMN, $SHOW_EMPTY_ROW; 1387 1390 1388 1391 global $SORTBY_HOSTNAME, $SORT_ORDER, $skan_str; … … 1455 1458 if( $SORTBY_HOSTNAME != "" ) 1456 1459 { 1457 1458 1460 $sorted = array(); 1459 1461 … … 1494 1496 if(( strpos( $SORTBY_HOSTNAME, $x_str ) < strpos( $SORTBY_HOSTNAME, $y_str ) ) && ( $x_present && $y_present )) 1495 1497 { 1496 1497 1498 $x_first = 1; 1498 1499 } … … 1531 1532 $y_min = null; 1532 1533 $y_max = null; 1534 1535 $x_columns = array(); 1536 $y_rows = array(); 1533 1537 1534 1538 // Now let's walk through all our nodes and see which one are valid for our scan pattern … … 1631 1635 $y_max = $y; 1632 1636 } 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 } 1633 1648 } 1634 1649 … … 1637 1652 // 1638 1653 $sorted_nodes = usort( $nodes, "cmp" ); 1654 1655 //print_r( $x_columns ) ; 1639 1656 1640 1657 $cur_node = 0; … … 1654 1671 if( $this->isBig() ) 1655 1672 { 1656 1657 1673 $y_offset = ($fontheight * (1 + strlen( $x_max) ) ) + ((2 + strlen( $x_max)) * $fontspaceing); 1658 1674 $x_offset = ($fontwidth * (1 + strlen( $y_max) ) ) + ((2 + strlen( $y_max)) * $fontspaceing); 1659 1660 1675 } 1661 1676 … … 1711 1726 } 1712 1727 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 // 1713 1735 for( $n = $x_min; $n <= $x_max; $n++ ) 1714 1736 { 1715 1737 for( $m = $y_min; $m <= $y_max; $m++ ) 1716 1738 { 1717 1718 1739 if( $x_min > 0 ) 1719 1740 { 1720 $x = $x_offset + ( ($n-$x_min) * $node_width ) ;1741 $x = $x_offset + ( ($n-$x_min) * $node_width ) - ($x_empty_count * $node_width); 1721 1742 } 1722 1743 if( $y_min > 0 ) 1723 1744 { 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; 1725 1772 } 1726 1773
Note: See TracChangeset
for help on using the changeset viewer.