/
servers.php
204 lines (199 loc) · 12.8 KB
/
servers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<?php
require_once(dirname(__FILE__) . '/lib/functions.php');
checkCaches();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="refresh" content="120">
<title>Acceptance Live Instances</title>
<link rel="shortcut icon" type="image/x-icon" href="/images/favicon.ico"/>
<link href="//netdna.bootstrapcdn.com/bootswatch/2.3.0/spacelab/bootstrap.min.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.0.2/css/font-awesome.css" rel="stylesheet">
<link href="./style.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1292368-28']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<!-- navbar ================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="/"><?=$_SERVER['SERVER_NAME'] ?></a>
<ul class="nav">
<li><a href="/">Home</a></li>
<li><a href="/features.php">Features</a></li>
<li class="active"><a href="/servers.php">Servers</a></li>
</ul>
</div>
</div>
</div>
<!-- /navbar -->
<!-- Main ================================================== -->
<div id="wrap">
<div id="main">
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="col-center" colspan="4">Product</th>
<th class="col-center" colspan="3">Deployment</th>
<th class="col-center" colspan="6">Ports</th>
</tr>
<tr>
<th class="col-center">Name</th>
<th class="col-center">Version</th>
<th class="col-center">Feature Branch</th>
<th class="col-center">Bundle</th>
<th class="col-center">Database</th>
<th class="col-center">Server</th>
<th class="col-center">Status</th>
<th class="col-center">Prefix</th>
<th class="col-center">HTTP</th>
<th class="col-center">ES</th>
<th class="col-center">AJP</th>
<th class="col-center">JMX RMI Registration</th>
<th class="col-center">JMX RMI Server</th>
<th class="col-center">CRaSH SSH</th>
</tr>
</thead>
<tbody>
<?php
$merged_list = getGlobalAcceptanceInstances();
$descriptor_arrays = array();
foreach ($merged_list as $tmp_array) {
$descriptor_arrays = array_merge($descriptor_arrays, $tmp_array);
}
function cmp($a, $b)
{
return strcmp($a->DEPLOYMENT_HTTP_PORT, $b->DEPLOYMENT_HTTP_PORT);
}
usort($descriptor_arrays, "cmp");
$servers_counter = array();
foreach ($descriptor_arrays as $descriptor_array) {
// Compute the number of deployed instances per acceptance server
$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['nb']=$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['nb']+1;
// Compute the minimum amount of JVM size allocated per acceptance server
if (strpos($descriptor_array->DEPLOYMENT_JVM_SIZE_MIN,'g')) {
$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-min']=$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-min']+str_replace('g','',$descriptor_array->DEPLOYMENT_JVM_SIZE_MIN);
} else if (strpos($descriptor_array->DEPLOYMENT_JVM_SIZE_MIN,'m')) {
$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-min']=$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-min']+(str_replace('m','',$descriptor_array->DEPLOYMENT_JVM_SIZE_MIN)/1000);
} else {
throw new Exception("The unit of the DEPLOYMENT_JVM_SIZE_MIN is not manage (".$descriptor_array->DEPLOYMENT_JVM_SIZE_MIN.")");
}
// Compute the maximum amount of JVM size allocated per acceptance server
if (strpos($descriptor_array->DEPLOYMENT_JVM_SIZE_MAX,'g')) {
$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-max']=$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-max']+str_replace('g','',$descriptor_array->DEPLOYMENT_JVM_SIZE_MAX);
} else if (strpos($descriptor_array->DEPLOYMENT_JVM_SIZE_MAX,'m')) {
$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-max']=$servers_counter[$descriptor_array->ACCEPTANCE_HOST]['jvm-max']+(str_replace('m','',$descriptor_array->DEPLOYMENT_JVM_SIZE_MAX)/1000);
} else {
throw new Exception("The unit of the DEPLOYMENT_JVM_SIZE_MAX is not manage (".$descriptor_array->DEPLOYMENT_JVM_SIZE_MAX.")");
}
if ($descriptor_array->DEPLOYMENT_STATUS == "Up")
$status = "<img width=\"16\" height=\"16\" src=\"/images/green_ball.png\" alt=\"Up\" class=\"left\"/> Up";
else
$status = "<img width=\"16\" height=\"16\" src=\"/images/red_ball.png\" alt=\"Down\" class=\"left\"/> Down !";
$matches = array();
if (preg_match("/([^\-]*)\-(.*\-.*)\-SNAPSHOT/", $descriptor_array->PRODUCT_VERSION, $matches)) {
$base_version = $matches[1];
$feature_branch = $matches[2];
} elseif (preg_match("/(.*)\-SNAPSHOT/", $descriptor_array->PRODUCT_VERSION, $matches)) {
$base_version = $matches[1];
$feature_branch = "";
} else {
$base_version = $descriptor_array->PRODUCT_VERSION;
$feature_branch = "";
}
?>
<tr>
<td><img src="/images/<?=$descriptor_array->DEPLOYMENT_APPSRV_TYPE?>.png" width="16" height="16" alt="<?=$descriptor_array->DEPLOYMENT_APPSRV_TYPE?> bundle" class="icon"/> <?php if (empty($descriptor_array->PRODUCT_DESCRIPTION)) echo $descriptor_array->PRODUCT_NAME; else echo $descriptor_array->PRODUCT_DESCRIPTION;?><?php if (!empty($descriptor_array->INSTANCE_ID)) echo " (" .$descriptor_array->INSTANCE_ID.")"; ?></td>
<td class="col-left"><?=$descriptor_array->PRODUCT_VERSION?></td>
<td class="col-right"><?=$feature_branch?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_APPSRV_TYPE?></td>
<td class="col-right"><?=$descriptor_array->DATABASE?></td>
<?php
if ($descriptor_array->ACCEPTANCE_HOST === "acceptance3.exoplatform.org") {
$host_html_color = "color-acceptance3";
} else if ($descriptor_array->ACCEPTANCE_HOST === "acceptance4.exoplatform.org") {
$host_html_color = "color-acceptance4";
} else if ($descriptor_array->ACCEPTANCE_HOST === "acceptance5.exoplatform.org") {
$host_html_color = "color-acceptance5";
} else if ($descriptor_array->ACCEPTANCE_HOST === "acceptance6.exoplatform.org") {
$host_html_color = "color-acceptance6";
} else {
$host_html_color = "color-acceptanceX";
}
?>
<td style="font-weight:bold;" class='col-right <?=$host_html_color?>'><?=$descriptor_array->ACCEPTANCE_HOST?></td>
<td class="col-left"><?= $status ?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_PORT_PREFIX?>xx</td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_HTTP_PORT?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_ES_HTTP_PORT?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_AJP_PORT?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_RMI_REG_PORT?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_RMI_SRV_PORT?></td>
<td class="col-right"><?=$descriptor_array->DEPLOYMENT_CRASH_SSH_PORT?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th class="col-center">hostname</th>
<th class="col-center">server name</th>
<th class="col-center">deployment<br />count</th>
<th class="col-center">JVM size<br />allocated</th>
<th class="col-center">characteristics</th>
</tr>
</thead>
<tbody>
<tr>
<td class="col-center">acceptance5.exoplatform.org</td>
<td class="col-center">prj03</td>
<td class="col-center"><?=$servers_counter["acceptance5.exoplatform.org"]['nb']?></td>
<td class="col-center"><?=$servers_counter["acceptance5.exoplatform.org"]['jvm-min']?>GB < ... < <?=$servers_counter["acceptance5.exoplatform.org"]['jvm-max']?>GB</td>
<td>RAM = 128GB <br /> CPU = Xeon W3530 2.80GHz (6 cores + hyperthreading = 12 threads) <br /> Disks = 2 x 2TB (sda = HGST HUS724020ALA640 / sdb = HGST HUS724020ALA640)</td>
</tr>
<tr>
<td class="col-center">acceptance7.exoplatform.org</td>
<td class="col-center">prd05</td>
<td class="col-center"><?=$servers_counter["acceptance7.exoplatform.org"]['nb']?></td>
<td class="col-center"><?=$servers_counter["acceptance7.exoplatform.org"]['jvm-min']?>GB < ... < <?=$servers_counter["acceptance6.exoplatform.org"]['jvm-max']?>GB</td>
<td>RAM = 128GB <br /> CPU = Xeon E5-1650 v2 @ 3.50GHz (6 cores + hyperthreading = 12 threads) <br /> Disks = 3 x 300GB SSD (sda = INTEL SSDSC2BB300H4 / sdb = INTEL SSDSC2BB300H4 / sdc = INTEL SSDSC2BB300H4)</td>
</tr> </tbody>
</table>
</div>
</div>
</div>
<!-- /container -->
</div>
</div>
<!-- Footer ================================================== -->
<div id="footer">Copyright © 2000-2016. All rights Reserved, eXo Platform SAS.</div>
</body>
</html>