<?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']);
<?php

/**
 * Summary of profiling
 */
require_once "WEB-INF/php/inc.php";
$profile = @new Java("com.caucho.profile.ProProfile");
$mbeanServer = new MBeanServer();
$server = $mbeanServer->getServer();
$title = "Resin: Profile {$server->Id}";
if (!$profile) {
    $title .= " - not available";
}
?>

<?php 
display_header("profile.php", $title, $server);
?>

<?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']);
Example #3
0
<?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);
//$value[0].attr = "resin:type=CpuLoadAvg";
$test_server_id = null;
$g_server_unique = true;
foreach ($items as $item) {
    $stat_data = new StatData();
    $stat_data->name = $item[0];
    // $stat_data->attr = $item[1];
    $server_id = $item[2];
    if (!$server_id) {
        $mbean_server = new MBeanServer();
    } else {
        if ($server_id == "default") {
            $mbean_server = new MBeanServer("");
            $stat_data->server = $server_id;
        } else {
            $mbean_server = new MBeanServer($server_id);
            $stat_data->server = $server_id;
        }
    }
    if (isset($test_server) && $test_server != $server_id) {
        $g_server_unique = false;
    }
    $test_server = $server_id;
    $stat_service = $mbean_server->getStatService();
    if (!$stat_service) {
        continue;
    }
    //  resin_var_dump($stat_data);
    $stat = find_stat($stat_service, $stat_data->name);
    if (!$stat) {
        //  resin_var_dump($stat_data);
echo "</tr>";
foreach ($resin->Clusters as $cluster) {
    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);
Example #6
0
<?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 : '\\"\\"';