QueueMonitor.php

Summary
QueueMonitor.php
QueueMonitorBase class for Queue monitors
QueueMonitorClass abstraction for a monitor that looks after a specific queue.
statsIncrement monitoring statistics for a given counter, if configured.
logStateSend thread state update to the monitoring server, if configured.
pingGeneral call to the monitoring server
pingUdp
pingHttp
prepMonitorData

QueueMonitor

Base class for Queue monitors

postActiv

the micro-blogging software

Copyright

Copyright © 2016-2017, Maiyannah Bishop

Derived from code copyright various sources

  • GNU Social © 2013-2016, Free Software Foundation, Inc
  • StatusNet © 2008-2012, StatusNet, Inc

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program.  If not, see http://www.gnu.org/licenses/.

https://www.gnu.org/licenses/agpl.html

About

Monitoring output helper for IoMaster and IoManager/QueueManager

PHP version

Tested with PHP 7

File Authors

Web

QueueMonitor

Class abstraction for a monitor that looks after a specific queue.

Summary
statsIncrement monitoring statistics for a given counter, if configured.
logStateSend thread state update to the monitoring server, if configured.
pingGeneral call to the monitoring server
pingUdp
pingHttp
prepMonitorData

stats

public function stats($key,  
$owners = array())

Increment monitoring statistics for a given counter, if configured.  Only explicitly listed thread/site/queue owners will be incremented.

Parameters

  • string $key - counter name
  • array $owners - list of owner keys like ‘queue:xmpp’ or ‘site:stat01’

logState

public function logState($threadId,  
$state,  
$substate = '')

Send thread state update to the monitoring server, if configured.

Parameters

  • string $thread - ID (eg ‘generic.1’)
  • string $state - ‘init’, ‘queue’, ‘shutdown’ etc
  • string $substate - optional, eg queue name ‘omb’ ‘sms’ etc

ping

protected function ping($data)

General call to the monitoring server

pingUdp

protected function pingUdp($target,
$data)

pingHttp

protected function pingHttp($target,
$data)

prepMonitorData

protected function prepMonitorData($data)
public function stats($key,  
$owners = array())
Increment monitoring statistics for a given counter, if configured.
public function logState($threadId,  
$state,  
$substate = '')
Send thread state update to the monitoring server, if configured.
protected function ping($data)
General call to the monitoring server
protected function pingUdp($target,
$data)
protected function pingHttp($target,
$data)
protected function prepMonitorData($data)