Permalink
Browse files

Updated README

  • Loading branch information...
1 parent 66331f0 commit d3e0d94c4e01ebdaf296d3373b6e004c14c2dc72 @yugene committed Jul 6, 2011
Showing with 4 additions and 99 deletions.
  1. +4 −4 README
  2. +0 −36 content.php
  3. +0 −59 templates/content.tpl.php
View
8 README
@@ -2,7 +2,7 @@ Gearman Monitor
Copyright (C) 2011 Yevgeny Yegorov
All rights reserved.
-Gearman Monitor is a tool to watch Gearman servers. Gearman
-server version and registered workers status is now available.
-Several Gearman servers can be monitored at the same time.
-Server and worker name filters can be applied.
+Gearman Monitor is a tool to watch [Gearman](http://gearman.org/) servers. Gearman
+server version, function queue and registered workers status is available. Several
+Gearman servers can be monitored at the same time. Server and function name filters
+can be applied.
View
@@ -1,36 +0,0 @@
-<?php
-
-require_once('_init.php');
-
-$options = array();
-$pageUri = "{$_SERVER['PHP_SELF']}?";
-
-if (isset($_REQUEST['filterServers']) && is_array($_REQUEST['filterServers']))
-{
- $options['filterServers'] = $_REQUEST['filterServers'];
- foreach ($options['filterServers'] as $filterServer)
- {
- $pageUri .= 'filterServers[]=' . intval($filterServer) . '&';
- }
-}
-if (isset($_REQUEST['filterName']) && strlen(trim($_REQUEST['filterName'])) > 0)
-{
- $options['filterName'] = $_REQUEST['filterName'];
- $pageUri .= "filterName=" . urlencode($_REQUEST['filterName']) . '&';
-}
-if (isset($_REQUEST['sort']) && strlen(trim($_REQUEST['sort'])) > 0)
-{
- $options['sort'] = $_REQUEST['sort'];
-}
-
-$serverList = new GA_ServerList($options);
-$serverList->addServers($cfgServers);
-
-$view->versionData = $serverList->getVersionData();
-$view->functionData = $serverList->getFunctionData();
-$view->errors = $serverList->getErrors();
-$view->pageUri = $pageUri;
-
-$view->display('content.tpl.php');
-
-?>
View
@@ -1,59 +0,0 @@
-<html>
-<head>
- <link rel="stylesheet" type="text/css" href="css/style.css" />
-</head>
-<body class="content">
-
- <?php foreach ($this->errors as $error) { ?>
- <div class="error"><?php echo htmlspecialchars($error); ?></div>
- <?php } ?>
-
- <h2>Gearman servers</h2>
-
- <table>
- <thead>
- <tr>
- <th>Server</th>
- <th>Version</th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach ($this->versionData as $serverIndex => $serverVersion) { ?>
- <tr class="<?php echo ($i % 2 ? "even" : "odd"); ?>">
- <td><?php echo htmlspecialchars($this->servers[$serverIndex]['name']); ?></td>
- <td class="ra"><?php echo $serverVersion; ?></td>
- </tr>
- <?php $i ++; } ?>
- </tbody>
- </table>
-
- <h2>Queue</h2>
-
- <table>
- <thead>
- <tr>
- <th><?php $this->fnSortCol($this->pageUri, 'Server', GA_ServerList::SORT_SERVER); ?></th>
- <th><?php $this->fnSortCol($this->pageUri, 'Function', GA_ServerList::SORT_NAME); ?></th>
- <th><?php $this->fnSortCol($this->pageUri, 'Jobs in queue', GA_ServerList::SORT_JOBS_IN_QUEUE); ?></th>
- <th><?php $this->fnSortCol($this->pageUri, 'Jobs running', GA_ServerList::SORT_JOBS_RUNNING); ?></th>
- <th><?php $this->fnSortCol($this->pageUri, 'Workers registered', GA_ServerList::SORT_WORKERS); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 0; foreach ($this->functionData as $functionItem) { ?>
- <tr class="<?php echo ($i % 2 ? "even" : "odd"); ?>">
- <td><?php echo htmlspecialchars($functionItem['server']); ?></td>
- <td><?php echo htmlspecialchars($functionItem['name']); ?></td>
- <td class="ra"><?php echo $functionItem['in_queue']; ?></td>
- <td class="ra"><?php echo $functionItem['jobs_running']; ?></td>
- <td class="ra">
- <?php if ($functionItem['capable_workers'] == 0 && $functionItem['in_queue'] > 0) { ?><img src="images/s_warn.png" /><?php } ?>
- <?php echo $functionItem['capable_workers']; ?>
- </td>
- </tr>
- <?php $i ++; } ?>
- </tbody>
- </table>
-
-</body>
-</html>

0 comments on commit d3e0d94

Please sign in to comment.