Changeset 305 for trunk/web/addons
- Timestamp:
- 04/16/07 17:32:56 (16 years ago)
- Location:
- trunk/web/addons/job_monarch
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/addons/job_monarch/conf.php
r299 r305 35 35 // The size of a single node in the small clusterimage 36 36 // 37 $SMALL_CLUSTERIMAGE_NODEWIDTH = 11; 37 $SMALL_CLUSTERIMAGE_NODEWIDTH = 7; 38 39 // Max size of small clusterimage 40 // (250 pixels is same width as Ganglia's pie chart) 41 // 42 $BIG_CLUSTERIMAGE_MAXWIDTH = 250; 43 44 // The size of a single node in the small clusterimage 45 // 46 $BIG_CLUSTERIMAGE_NODEWIDTH = 11; 47 48 // Max size of small host image 49 // 50 $SMALL_HOSTIMAGE_MAXWIDTH = 450; 38 51 39 52 // How to mark nodes with a job in clusterimage -
trunk/web/addons/job_monarch/image.php
r303 r305 61 61 $data_gatherer->parseXML(); 62 62 63 if( $data_gatherer->isJobmonRunning() ) 63 if( $data_gatherer->isJobmonRunning() ) { 64 64 $ic = new ClusterImage( $clustername ); 65 else 65 $ic->setSmall(); 66 } else { 66 67 $ic = new EmptyImage(); 68 } 67 69 68 70 $ic->draw(); … … 74 76 75 77 $ic = new ClusterImage( $clustername ); 78 $ic->setBig(); 76 79 77 80 if( isset( $filter ) ) { -
trunk/web/addons/job_monarch/libtoga.php
r303 r305 769 769 function NodeImage( $hostname ) { 770 770 771 global $SMALL_CLUSTERIMAGE_NODEWIDTH; 772 771 773 $this->jobs = array(); 772 774 //$this->image = $image; … … 777 779 $this->cpus = $this->determineCpus(); 778 780 $this->showinfo = 1; 781 $this->size = $SMALL_CLUSTERIMAGE_NODEWIDTH; 779 782 } 780 783 … … 844 847 } 845 848 849 function drawSmall() { 850 851 global $SMALL_CLUSTERIMAGE_NODEWIDTH; 852 853 $this->size = $SMALL_CLUSTERIMAGE_NODEWIDTH; 854 855 $this->draw(); 856 } 857 858 function drawBig() { 859 860 global $BIG_CLUSTERIMAGE_NODEWIDTH; 861 862 $this->size = $BIG_CLUSTERIMAGE_NODEWIDTH; 863 864 $this->draw(); 865 } 866 846 867 function draw() { 847 868 848 $this->drawSmall();849 }850 851 function drawBig() {852 853 }854 855 function drawSmall() {856 857 global $SMALL_CLUSTERIMAGE_NODEWIDTH;858 869 global $JOB_NODE_MARKING; 859 870 860 871 $black_color = imageColorAllocate( $this->image, 0, 0, 0 ); 861 $size = $ SMALL_CLUSTERIMAGE_NODEWIDTH;872 $size = $this->size; 862 873 863 874 imageFilledRectangle( $this->image, $this->x, $this->y, $this->x+($size), $this->y+($size), $black_color ); … … 920 931 function ClusterImage( $clustername ) { 921 932 922 //printf( "image cluster = %s\n", $clustername ); 923 $this->dataget = new DataGatherer( $clustername ); 924 $this->clustername = $clustername; 925 $this->filters = array(); 933 $this->dataget = new DataGatherer( $clustername ); 934 $this->clustername = $clustername; 935 $this->filters = array(); 936 $this->size = 's'; 937 } 938 939 function setSmall() { 940 $this->size = 's'; 941 } 942 943 function setBig() { 944 $this->size = 'b'; 945 } 946 947 function isSmall() { 948 return ($this->size == 's'); 949 } 950 951 function isBig() { 952 return ($this->size == 'b'); 926 953 } 927 954 928 955 function setFilter( $filtername, $filtervalue ) { 929 956 930 //printf("filter %s = %s\n", $filtername, $filtervalue );931 //printf( "filter set to %s = %s\n", $filtername, $filtervalue );932 957 $this->filters[$filtername] = $filtervalue; 933 //print_r($this->filters);934 958 } 935 959 … … 953 977 954 978 foreach( $this->filters as $filtername => $filtervalue ) { 955 956 //printf("filter bla %s = %s\n", $filtername,$filtervalue );957 979 958 980 if( $filtername!=null && $filtername!='' ) { … … 960 982 if( $filtername == 'jobid' && !$node->hasJob( $filtervalue) ) { 961 983 $addhost = 0; 962 //printf("host %s has no job %s\n", $hostname, $filtervalue);963 984 } else if( $filtername != 'jobid' ) { 964 //printf("myjob is %s\n", $myjob );965 985 if( $jobs[$myjob][$filtername] != $filtervalue ) { 966 //printf("host %s has no job with %s=%s\n", $hostname, $filtername, $filtervalue);967 986 $addhost = 0; 968 987 } … … 984 1003 function draw() { 985 1004 986 //printf("stopt met uitvoer");987 //return;988 989 1005 global $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH; 1006 global $BIG_CLUSTERIMAGE_MAXWIDTH, $BIG_CLUSTERIMAGE_NODEWIDTH; 990 1007 991 1008 $mydatag = $this->dataget; 992 1009 $mydatag->parseXML(); 993 1010 994 //$max_width = 250;995 //$node_width = 11;996 997 $max_width = $SMALL_CLUSTERIMAGE_MAXWIDTH;998 $node_width = $SMALL_CLUSTERIMAGE_NODEWIDTH;999 1000 //printf( "cmaxw %s nmaxw %s", $SMALL_CLUSTERIMAGE_MAXWIDTH, $SMALL_CLUSTERIMAGE_NODEWIDTH );1011 if( $this->isSmall() ) { 1012 $max_width = $SMALL_CLUSTERIMAGE_MAXWIDTH; 1013 $node_width = $SMALL_CLUSTERIMAGE_NODEWIDTH; 1014 } else if( $this->isBig() ) { 1015 $max_width = $BIG_CLUSTERIMAGE_MAXWIDTH; 1016 $node_width = $BIG_CLUSTERIMAGE_NODEWIDTH; 1017 } 1001 1018 1002 1019 $nodes = $mydatag->getNodes(); … … 1056 1073 $nodes[$host]->setShowinfo( 0 ); 1057 1074 1058 $nodes[$host]->draw(); 1075 if( $this->isSmall() ) 1076 $nodes[$host]->drawSmall(); 1077 else if( $this->isBig() ) 1078 $nodes[$host]->drawBig(); 1059 1079 } 1060 1080 }
Note: See TracChangeset
for help on using the changeset viewer.