Package: timera
Copyright (c) 2017 the Timera authors and contributors <see AUTHORS.txt file>.Permission is hereby granted, free of charge, to any person obtaining a copy of thissoftware and associated documentation files (the "Software"), to deal in the Softwarewithout restriction, including without limitation the rights to use, copy, modify, merge,publish, distribute, sublicense, and/or sell copies of the Software, and to permit personsto whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies orsubstantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULARPURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLEFOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OROTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHERDEALINGS IN THE SOFTWARE.Portions of the code marked as "stolen from Paste" are provided under thefollowing license:Copyright (c) 2005 Ian Bicking and ContributorsPermission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the"Software"), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Description: Timera======Store metrics in InfluxDB... figure:: docs/img/plugin-httptimer-grafana-dashboard-1.png:scale: 50 %:alt: Grafana DashboardGrafana DashboardThere's currently one plugin included with Timera, ``httptimer``.With ``httptimer``, you can store the time it takes to get http responses. For example:.. code-block:: ini[httptimer_plugin_01]name = www.google.comurl = https://www.google.com/proxy = http://proxy.example.com:3128/include_direct = trueSee the config file, `config.ini <https://github.com/natej/timera/blob/master/config.ini>`_, for options.Use any InfluxDB-compatible visualization software to view your metrics. For example:- `Chronograf <https://portal.influxdata.com/downloads>`_- `Grafana <http://docs.grafana.org/features/datasources/influxdb/>`_Plugins-------Timera has a simple plugin system. So it's easy to write your own plugin to collect and store the metrics you want.See the custom plugin below and the included plugin`httptimer <https://github.com/natej/timera/blob/master/timera/plugins/httptimer/>`_ for examples.Config file:.. code-block:: ini[mymetrics_plugin_01]plugin_import = mymetrics.metricsname = cpu_load_shortfield = value``mymetrics/metrics.py``:.. code-block:: pythonimport loggingimport timeralog = logging.getLogger(__name__)def get_metrics(config, timestamp, plugin):""":param config: ConfigParser instance:param timestamp: unix timestamp (seconds since epoch) for current collection interval:param plugin: dict with parsed plugin values"""measurement = plugin['config']['name']field = plugin['config']['field']metric = 0.64fields = {field: str(metric)}tags = {'host': 'server01', 'region': 'us-west'}log.info('%s %r: %s=%f' % (measurement, tags, field, metric))measurementd = dict(measurement=measurement, time=timestamp, fields=fields, tags=tags)idbc = timera.db.get_client(config)timera.db.write_points(idbc, [measurementd])If you create a plugin you think others would find useful, please submit a PR with tests for inclusion in Timera.Requirements------------- `InfluxDB <https://portal.influxdata.com/downloads>`_- `Python <https://www.python.org/>`_ 2.7 or 3.6, pip and setuptools.Install-------.. code-block:: bash$ pip install timeraOr if using a virtual environment:.. code-block:: bash$ source env/bin/activate$ pip install timeraDevelopment Install-------------------Use ``make install-dev`` to install in editable mode (``pip install -e .``) with pytest and tox:.. code-block:: bash$ source env/bin/activate$ cd timera-master$ make install-dev$ make test$ toxRun It------Create db and start collecting metrics:.. code-block:: bash# edit config.ini$ timera config.ini reset_db$ timera config.ini startOptional--------Use `Supervisor <https://github.com/Supervisor/supervisor>`_ to run Timera. See the`contrib dir <https://github.com/natej/timera/blob/master/contrib/>`_. Supervisor requiresPython 2 (``pip install supervisor``).Viewing Metrics with Grafana----------------------------Configure `InfluxDB as a datasource <http://docs.grafana.org/features/datasources/influxdb/>`_.For the ``httptimer`` plugin, create a `graph panel <http://docs.grafana.org/features/panels/graph/>`_ andconfigure the query:.. figure:: docs/img/plugin-httptimer-grafana-metrics-tab-1.png:scale: 50 %:alt: Grafana Metrics TabGrafana Metrics TabChanges-------See `CHANGES.rst <https://github.com/natej/timera/blob/master/CHANGES.rst>`_.License-------Timera is provided under the MIT License. See `LICENSE.txt <https://github.com/natej/timera/blob/master/LICENSE.txt>`_.Keywords: influxdb system network monitoringPlatform: UNKNOWNClassifier: Development Status :: 4 - BetaClassifier: Topic :: DatabaseClassifier: Topic :: System :: MonitoringClassifier: Topic :: System :: Networking :: MonitoringClassifier: Topic :: System :: Systems AdministrationClassifier: License :: OSI Approved :: MIT LicenseClassifier: Programming Language :: Python :: 2Classifier: Programming Language :: Python :: 2.7Classifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3.6Classifier: Operating System :: Microsoft :: WindowsClassifier: Operating System :: POSIXRequires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*