Skip to content
This repository
Browse code

Updated README

  • Loading branch information...
commit d3e0d94c4e01ebdaf296d3373b6e004c14c2dc72 1 parent 66331f0
Yevgeny Yegorov authored

Showing 3 changed files with 4 additions and 99 deletions. Show diff stats Hide diff stats

  1. +4 4 README
  2. +0 36 content.php
  3. +0 59 templates/content.tpl.php
8 README
@@ -2,7 +2,7 @@ Gearman Monitor
2 2 Copyright (C) 2011 Yevgeny Yegorov
3 3 All rights reserved.
4 4
5   -Gearman Monitor is a tool to watch Gearman servers. Gearman
6   -server version and registered workers status is now available.
7   -Several Gearman servers can be monitored at the same time.
8   -Server and worker name filters can be applied.
  5 +Gearman Monitor is a tool to watch [Gearman](http://gearman.org/) servers. Gearman
  6 +server version, function queue and registered workers status is available. Several
  7 +Gearman servers can be monitored at the same time. Server and function name filters
  8 +can be applied.
36 content.php
... ... @@ -1,36 +0,0 @@
1   -<?php
2   -
3   -require_once('_init.php');
4   -
5   -$options = array();
6   -$pageUri = "{$_SERVER['PHP_SELF']}?";
7   -
8   -if (isset($_REQUEST['filterServers']) && is_array($_REQUEST['filterServers']))
9   -{
10   - $options['filterServers'] = $_REQUEST['filterServers'];
11   - foreach ($options['filterServers'] as $filterServer)
12   - {
13   - $pageUri .= 'filterServers[]=' . intval($filterServer) . '&';
14   - }
15   -}
16   -if (isset($_REQUEST['filterName']) && strlen(trim($_REQUEST['filterName'])) > 0)
17   -{
18   - $options['filterName'] = $_REQUEST['filterName'];
19   - $pageUri .= "filterName=" . urlencode($_REQUEST['filterName']) . '&';
20   -}
21   -if (isset($_REQUEST['sort']) && strlen(trim($_REQUEST['sort'])) > 0)
22   -{
23   - $options['sort'] = $_REQUEST['sort'];
24   -}
25   -
26   -$serverList = new GA_ServerList($options);
27   -$serverList->addServers($cfgServers);
28   -
29   -$view->versionData = $serverList->getVersionData();
30   -$view->functionData = $serverList->getFunctionData();
31   -$view->errors = $serverList->getErrors();
32   -$view->pageUri = $pageUri;
33   -
34   -$view->display('content.tpl.php');
35   -
36   -?>
59 templates/content.tpl.php
... ... @@ -1,59 +0,0 @@
1   -<html>
2   -<head>
3   - <link rel="stylesheet" type="text/css" href="css/style.css" />
4   -</head>
5   -<body class="content">
6   -
7   - <?php foreach ($this->errors as $error) { ?>
8   - <div class="error"><?php echo htmlspecialchars($error); ?></div>
9   - <?php } ?>
10   -
11   - <h2>Gearman servers</h2>
12   -
13   - <table>
14   - <thead>
15   - <tr>
16   - <th>Server</th>
17   - <th>Version</th>
18   - </tr>
19   - </thead>
20   - <tbody>
21   - <?php $i = 0; foreach ($this->versionData as $serverIndex => $serverVersion) { ?>
22   - <tr class="<?php echo ($i % 2 ? "even" : "odd"); ?>">
23   - <td><?php echo htmlspecialchars($this->servers[$serverIndex]['name']); ?></td>
24   - <td class="ra"><?php echo $serverVersion; ?></td>
25   - </tr>
26   - <?php $i ++; } ?>
27   - </tbody>
28   - </table>
29   -
30   - <h2>Queue</h2>
31   -
32   - <table>
33   - <thead>
34   - <tr>
35   - <th><?php $this->fnSortCol($this->pageUri, 'Server', GA_ServerList::SORT_SERVER); ?></th>
36   - <th><?php $this->fnSortCol($this->pageUri, 'Function', GA_ServerList::SORT_NAME); ?></th>
37   - <th><?php $this->fnSortCol($this->pageUri, 'Jobs in queue', GA_ServerList::SORT_JOBS_IN_QUEUE); ?></th>
38   - <th><?php $this->fnSortCol($this->pageUri, 'Jobs running', GA_ServerList::SORT_JOBS_RUNNING); ?></th>
39   - <th><?php $this->fnSortCol($this->pageUri, 'Workers registered', GA_ServerList::SORT_WORKERS); ?></th>
40   - </tr>
41   - </thead>
42   - <tbody>
43   - <?php $i = 0; foreach ($this->functionData as $functionItem) { ?>
44   - <tr class="<?php echo ($i % 2 ? "even" : "odd"); ?>">
45   - <td><?php echo htmlspecialchars($functionItem['server']); ?></td>
46   - <td><?php echo htmlspecialchars($functionItem['name']); ?></td>
47   - <td class="ra"><?php echo $functionItem['in_queue']; ?></td>
48   - <td class="ra"><?php echo $functionItem['jobs_running']; ?></td>
49   - <td class="ra">
50   - <?php if ($functionItem['capable_workers'] == 0 && $functionItem['in_queue'] > 0) { ?><img src="images/s_warn.png" /><?php } ?>
51   - <?php echo $functionItem['capable_workers']; ?>
52   - </td>
53   - </tr>
54   - <?php $i ++; } ?>
55   - </tbody>
56   - </table>
57   -
58   -</body>
59   -</html>

0 comments on commit d3e0d94

Please sign in to comment.
Something went wrong with that request. Please try again.