Metric collection agent for Numenta Rogue showcase application
Project description
Numenta Rogue
=============
Metrics collection agent for the Numenta Rogue showcase application and
consists of two primary components: A long-running metric collection agent,
which periodically polls various metrics and records the results to a local
database, and a separate process for forwarding metrics to a Grok server for
analysis.
Each metric collection agent is executed in a continuously-running gevent
Greenlet, with a pre-determined wait interval between samples. Each sample
is cached locally in a dedicated RRDTool database. Individual metrics are
implemented as subclasses of `avogadro.agent.AvogadroAgent()`, and must
implement a `collect()` method, which returns the metric value.
The `rogue-forward` process fetches metric data from the individual RRDTool
databases using the `rrdtool fetch` command, and sends the metric data using
the Grok Custom Metric API. Each time the `rogue-forward` process is
executed, the most recent timestamp is cached locally, and is used as a
starting point for subsequent requests.
Usage
-----
Install RRDTool::
brew install rrdtool
Install in development mode::
python setup.py develop --install-dir=... --script-dir=...
Start key-counter with nohup::
nohup rogue-keycounter > rogue-keys.stdout 2> rogue-keys.stderr < /dev/null &
Make sure that iTerm/Terminal is allowed in System Prefrences > Security & Privacy > Privacy > Accessibility!
Start metric collection agent with nohup::
nohup rogue-agent --prefix=var/db/ --interval=300 --hearbeat=600 > rogue-agent.stdout 2> rogue-agent.stderr < /dev/null &
Forward pending metric data to Grok once::
rogue-forward --server=https://localhost --prefix=var/db
Sample crontab entry::
* * * * * PATH=$PATH:/usr/local/bin PYTHONPATH=... .../rogue-forward --server=... --prefix=... > .../rogue-forward.stdout 2> .../rogue-forward.stderr < /dev/null
Export to local CSV
~~~~~~~~~~~~~~~~~~~
All metric data is written to a local round-robin database, which only retains
the two most recent weeks of data at any given moment in time. Should you want
the data exported to CSV, use the `rogue-export` utility::
rogue-export --prefix=var/db
The exporter keeps track of the position of a given metric, so you can run
`rogue-export` as frequently as you like, and the `.csv` files in `var/db/`,
will be updated accordingly. i.e. you can periodically sync the round-robin
database to a csv file in `var/db/`
Metrics
-------
CPUPercent
~~~~~~~~~~
Total CPU utilization as a percentage, as reported by ``psutil.cpu_percent()``.
MemoryPercent
~~~~~~~~~~~~~
The percentage memory usage calculated as `(total - available) / total * 100`,
as reported by ``psutil.virtual_memory().percent``
DiskReadBytes
~~~~~~~~~~~~~
Number of bytes read (total), as reported by
``psutil.disk_io_counters.read_bytes``
DiskWriteBytes
~~~~~~~~~~~~~
Number of bytes written (total), as reported by
``psutil.disk_io_counters.write_bytes``
DiskReadTime
~~~~~~~~~~~~
Time spent reading from disk (in milliseconds), as reported by
``psutil.disk_io_counters.read_time``
DiskWriteTime
~~~~~~~~~~~~~
Time spent writing to disk (in milliseconds), as reported by
``psutil.disk_io_counters.write_time``
NetworkBytesSent
~~~~~~~~~~~~~~~~
Number of bytes sent, as reported by ``psutil.net_io_counters.bytes_sent()``
NetworkBytesReceived
~~~~~~~~~~~~~~~~~~~~
Number of bytes received, as reported by
``psutil.net_io_counters.bytes_recv()``
=============
Metrics collection agent for the Numenta Rogue showcase application and
consists of two primary components: A long-running metric collection agent,
which periodically polls various metrics and records the results to a local
database, and a separate process for forwarding metrics to a Grok server for
analysis.
Each metric collection agent is executed in a continuously-running gevent
Greenlet, with a pre-determined wait interval between samples. Each sample
is cached locally in a dedicated RRDTool database. Individual metrics are
implemented as subclasses of `avogadro.agent.AvogadroAgent()`, and must
implement a `collect()` method, which returns the metric value.
The `rogue-forward` process fetches metric data from the individual RRDTool
databases using the `rrdtool fetch` command, and sends the metric data using
the Grok Custom Metric API. Each time the `rogue-forward` process is
executed, the most recent timestamp is cached locally, and is used as a
starting point for subsequent requests.
Usage
-----
Install RRDTool::
brew install rrdtool
Install in development mode::
python setup.py develop --install-dir=... --script-dir=...
Start key-counter with nohup::
nohup rogue-keycounter > rogue-keys.stdout 2> rogue-keys.stderr < /dev/null &
Make sure that iTerm/Terminal is allowed in System Prefrences > Security & Privacy > Privacy > Accessibility!
Start metric collection agent with nohup::
nohup rogue-agent --prefix=var/db/ --interval=300 --hearbeat=600 > rogue-agent.stdout 2> rogue-agent.stderr < /dev/null &
Forward pending metric data to Grok once::
rogue-forward --server=https://localhost --prefix=var/db
Sample crontab entry::
* * * * * PATH=$PATH:/usr/local/bin PYTHONPATH=... .../rogue-forward --server=... --prefix=... > .../rogue-forward.stdout 2> .../rogue-forward.stderr < /dev/null
Export to local CSV
~~~~~~~~~~~~~~~~~~~
All metric data is written to a local round-robin database, which only retains
the two most recent weeks of data at any given moment in time. Should you want
the data exported to CSV, use the `rogue-export` utility::
rogue-export --prefix=var/db
The exporter keeps track of the position of a given metric, so you can run
`rogue-export` as frequently as you like, and the `.csv` files in `var/db/`,
will be updated accordingly. i.e. you can periodically sync the round-robin
database to a csv file in `var/db/`
Metrics
-------
CPUPercent
~~~~~~~~~~
Total CPU utilization as a percentage, as reported by ``psutil.cpu_percent()``.
MemoryPercent
~~~~~~~~~~~~~
The percentage memory usage calculated as `(total - available) / total * 100`,
as reported by ``psutil.virtual_memory().percent``
DiskReadBytes
~~~~~~~~~~~~~
Number of bytes read (total), as reported by
``psutil.disk_io_counters.read_bytes``
DiskWriteBytes
~~~~~~~~~~~~~
Number of bytes written (total), as reported by
``psutil.disk_io_counters.write_bytes``
DiskReadTime
~~~~~~~~~~~~
Time spent reading from disk (in milliseconds), as reported by
``psutil.disk_io_counters.read_time``
DiskWriteTime
~~~~~~~~~~~~~
Time spent writing to disk (in milliseconds), as reported by
``psutil.disk_io_counters.write_time``
NetworkBytesSent
~~~~~~~~~~~~~~~~
Number of bytes sent, as reported by ``psutil.net_io_counters.bytes_sent()``
NetworkBytesReceived
~~~~~~~~~~~~~~~~~~~~
Number of bytes received, as reported by
``psutil.net_io_counters.bytes_recv()``
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
numenta-rogue-1.0.1.tar.gz
(25.2 kB
view details)
Built Distributions
numenta_rogue-1.0.1-py2.7.egg
(24.6 kB
view details)
File details
Details for the file numenta-rogue-1.0.1.tar.gz
.
File metadata
- Download URL: numenta-rogue-1.0.1.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd95fafa6a14412989792dd9645bb578289b450f53e2ff674c4dec9976afacfd |
|
MD5 | c2cc745767b386c818709a375f86d517 |
|
BLAKE2b-256 | 535dd305aea222d5646a0a5485193e3852f7b1a75e3d514b420c8cd7f76cfa39 |
File details
Details for the file numenta_rogue-1.0.1-py2.7.egg
.
File metadata
- Download URL: numenta_rogue-1.0.1-py2.7.egg
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20e642a83427d323207d2a6761bf13220cc08c54b32c1a7df9bfa7f913a5a22e |
|
MD5 | 87f8d72a9a3c285104c4e31503cca7d4 |
|
BLAKE2b-256 | 4ac0c753a065cb7d3032d7711fe47b515a4602f4bd49499ce45d579e2cb4fc5f |
File details
Details for the file numenta_rogue-1.0.1-py2-none-any.whl
.
File metadata
- Download URL: numenta_rogue-1.0.1-py2-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac39240a92caadd37c1b8bdbae125d03c360cb420ecc0b63ae8458d13c67a49b |
|
MD5 | 101f551ccb1892c82ffe57434d77b575 |
|
BLAKE2b-256 | e806c4f91d1401f885aa59fb02e711dab81e4d60cedc858967bf10a120a3b414 |