<?php /** * Summary of profiling */ require_once "WEB-INF/php/inc.php"; $profile = @new Java("com.caucho.profile.Profile"); $mbeanServer = new MBeanServer(); $server = $mbeanServer->lookup("resin:type=Server"); $title = "Resin: Profile {$server->Id}"; if (!$profile) { $title .= " - not available"; } ?> <?php display_header("profile.php", $title, $server->Id); ?> <?php if ($profile) { if ($_POST['action'] == 'stop') { $profile->stop(); } else { if ($_POST['action'] == 'start') { $profile->start(); if ($_POST['period'] >= 10) { $profile->setPeriod($_POST['period']); } if ($_POST['depth'] >= 1) { $profile->setDepth($_POST['depth']);
if (empty($cluster->Servers)) { continue; } echo "<tr><td colspan='8'>{$cluster->Name}</th></tr>\n"; $client_names = array(); if ($cluster->Name == $server->Cluster->Name) { $client_names[] = $server->Id; } foreach ($cluster->Servers as $client) { $client_names[] = $client->Name; } sort($client_names); foreach ($client_names as $name) { $sub_mbean_server = new MBeanServer($name); echo "<tr><th>{$name}</th>"; $sub_server = $sub_mbean_server->lookup("resin:type=Server"); if ($sub_server) { echo "<td>" . sprintf("%.2f", $sub_server->RuntimeMemory / (1024 * 1024)) . "</td>"; echo "<td>" . sprintf("%.2f", $sub_server->RuntimeMemoryFree / (1024 * 1024)) . "</td>"; echo "<td>" . sprintf("%.2f", $sub_server->CpuLoadAvg) . "</td>"; } else { echo "<td></td>"; echo "<td></td>"; echo "<td></td>"; } $proxy_cache = $sub_mbean_server->lookup("resin:type=ProxyCache"); if ($proxy_cache) { echo "<td>"; echo format_miss_ratio($proxy_cache->HitCountTotal, $proxy_cache->MissCountTotal); echo "</td>"; } else {
<?php /** * Summary of caching */ require_once "WEB-INF/php/inc.php"; $mbeanServer = new MBeanServer(); $resin = $mbeanServer->lookup("resin:type=Resin"); $server = $mbeanServer->lookup("resin:type=Server"); $block_cache = $mbeanServer->lookup("resin:type=BlockManager"); $proxy_cache = $mbeanServer->lookup("resin:type=ProxyCache"); $title = "Resin: Cache"; if (!empty($server->Id)) { $title = $title . " for server " . $server->Id; } ?> <?php display_header("cache.php", $title, $server->Id); ?> <h2>Server: <?php echo $server->Id; ?> </h2> <table class="data"> <tr title="Percentage of requests that have been served from the proxy cache:"> <th>Proxy cache miss ratio:</th> <td><?php echo format_miss_ratio($proxy_cache->HitCountTotal, $proxy_cache->MissCountTotal);
<?php /** * Provides the most important status information about the Resin server. * * @author Sam */ require_once "WEB-INF/php/inc.php"; $mbeanServer = new MBeanServer(); $resin = $mbeanServer->lookup("resin:type=Resin"); $server = $mbeanServer->lookup("resin:type=Server"); $title = "Resin: Status"; if (!empty($server->Id)) { $title = $title . " for server " . $server->Id; } ?> <?php display_header("status.php", $title, $server->Id); ?> <h2>Server: <?php echo $server->Id; ?> </h2> <table class="data"> <tr title="The server id used when starting this instance of Resin, the value of `-server'."> <th>Server id:</th> <td><?php echo $server->Id ? $server->Id : '\\"\\"';