What is "Collector"?
Collector is the component in charge of subscribing to the channel where stats and events are published. Message storing policies are determined by matching type or a regexp defined in the config file., (*1)
You can configure:, (*2)
-
Your stats types, adding operations: counter, median, percentile 95, min, max, etc., (*3)
-
Retention:, (*4)
-
History time (N days), (*5)
-
Sample (N seconds or N minutes or N hours), (*6)
Also "Collector" offers a JSON API to query stored stats (used by WebUIStats component)., (*7)
Requirements
- PHP 5.3.2 and up with pcntl extension installed.
- RabbitMQ or ZMQ.
- MongoDB
Libraries and services used
- PHP
- Pimple
- Silex
- Symfony Components:
- PhpAmqpLib
- Monolog
- MongoDB
- RabbitMQ/ZMQ+OpenPGM
Installation
The best way to install is to clone the repository and then configure as you need. See "Configuration" section., (*8)
After cloning you must install dependencies using "composer":, (*9)
php composer.phar update
Usage
Start collector server:, (*10)
php app/collector.php -c app/config/stats_test.yml
Configuration
All configuration is done using a YAML file., (*11)
Config file is structured in 4 sections:, (*12)
-
storage:, (*13)
- class name in charge of process and store messages.
-
output:, (*14)
- storage name configured to get data to the JSON API.
-
channel:, (*15)
- class name that subscribe to the channel to get messages.
-
stats:, (*16)
- stat types definition. Assign some operations and retention time.
- config can be defined by type or by a regexp
See config file for more details and examples., (*17)
Use of ZMQ is discontinued because a memory leak using ZMQ with OpenPGM PUB/SUB., (*18)