Changeset 569 for trunk/web2/addons/job_monarch/jobstore.php
- Timestamp:
- 01/26/09 13:06:22 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web2/addons/job_monarch/jobstore.php
r566 r569 61 61 $_SESSION["data"] = &$myxml_data; 62 62 63 global $jobs ;63 global $jobs, $metrics; 64 64 65 65 $data_gatherer = new DataGatherer( $clustername ); … … 92 92 getNodes(); 93 93 break; 94 case "GETMETRICS": 95 getMetrics(); 96 break; 94 97 default: 95 98 echo "{failure:true}"; 96 99 break; 100 } 101 102 function getMetrics( $host=null ) 103 { 104 global $metrics; 105 106 reset($metrics); 107 if( !$host) 108 { 109 $firsthost = key($metrics); 110 } 111 else 112 { 113 $firsthost = $host; 114 } 115 116 $first_metrics = $metrics[$firsthost]; 117 118 $metric_list = array(); 119 120 $metric_count = 0; 121 122 foreach( $first_metrics as $metricname => $metricval ) 123 { 124 $metric = array(); 125 $metric['id'] = $metricname; 126 $metric['name'] = $metricname; 127 128 $metric_list[] = $metric; 129 $metric_count = $metric_count + 1; 130 } 131 132 $results = array(); 133 $results['names'] = $metric_list; 134 $results['total'] = $metric_count; 135 136 $jsonresults = JEncode( $results ); 137 138 echo $jsonresults; 139 140 return 0; 97 141 } 98 142
Note: See TracChangeset
for help on using the changeset viewer.