Package: serialkiller
.. figure:: screenshot.png:alt: sample resultAbout=====``serialkiller`` time series database with reduce system, it kill the same time series ! :)``serialkiller`` can be used in three different ways:- In command line- In http API REST mode- From libraryIn future, ``serialkiller`` will be run in centralized or decentralized modeSample architecture.. figure:: architecture.png:alt: architecture exampleInstalling==========To install the latest release from `PyPI <http://pypi.python.org/pypi/serialkiller>`_::$ pip install serialkillerTo install the latest development version from `GitHub <https://github.com/badele/serialkiller>`_::$ pip install git+git://github.com/badele/serialkiller.gitConfiguration & Examples========================Copy sk_config.cfg from serialkiller package to /etc/sk_config.cfg and edit your ``.bashrc``, add this line::SERIALKILLER_SETTINGS=/etc/sk_config.cfgThe default `sk_config.cfg`::STORAGE = "/tmp/sensors"HOST = 0.0.0.0PORT = 80DEBUG = FalseNow you can run the serialkiller standalone server with `sk_standalone`::sk_server &You can also use the supervisor, it's prefered solutionExample of sk_server supervisor configuration::[program:sk_server]command=sk_serverenvironment=SERIALKILLER_SETTINGS="/etc/sk_config.cfg"user=usernameautostart=trueautorestart=trueredirect_stderr=truestartsecs=5Example, if now you would like add a minimal sensor (ex: online computer) with auto-configuration type sensor::# From command linesk_command -a addvalue -s domsrv:computer:online -t byte -v value=255# From REST APIwget serverip/api/1.0/addValue/domsrv:computer:online/byte/value=255# From libraryfrom serialkiller import libobj = lib.Sensor(args.directory, args.sensorid, args.type)data = sktypes.newObj('byte', value=255)obj.addValue(data)List last sensors value::$ sk_command -a sensorslistSensorId                       S    Time                 Title                         Value-----------------------------  ---  -------------------  ----------------------------  -----------livingroom:demo:online              2014-01-31 08:50:55  Demo                          Onlinelivingroom:vaio:inuse          X    2014-01-30 23:17:14  Utilisation du poste          Lockedwashroom:teleinfo:isousc            2014-01-31 08:51:00  Ampere souscrit               30livingroom:p03:online               2014-01-31 08:51:00  Serveur de virtualisation     Onlinelivingroom:vaio:online              2014-01-31 08:51:00  Portable stephanie            Offlinewashroom:teleinfo:hchp              2014-01-31 08:51:00  Heure pleine                  39674892washroom:teleinfo:papp              2014-01-31 08:51:00  Puissance en cours            1980washroom:video:online               2014-01-31 08:50:55  Video server                  Onlinelivingroom:internet:available       2014-01-31 08:50:55  Conectiviteinternet           Availablewashroom:teleinfo:iinst        X    2014-01-31 00:22:47  Ampere en cours               10city:weather:sunshine               2014-01-31 08:50:55  Crepuscule du soleil          Plein joursShow sensor information::$ sk_command -a sensorinfos -s domsrv:teleinfo:papp -t ushortTitle                    Value-----------------------  --------------------------Sensorid                 domsrv:teleinfo:pappSensor Type              ushortNB lines                 109845Min date                 2012-06-27 16:43:00Max date                 2014-01-28 21:25:30Min value                350 (2013-12-21 10:22:21)Max value                6710 (2013-08-07 18:57:14)Avg value                1578Avg delta (round ratio)  303Total size               1.361328125 MoShow last sensor value::$ sk_command -a last -s domsrv:teleinfo:papp -t ushort1730Show datas sensor::$ sk_command -a sensordatas -s domsrv:teleinfo:papp -t ushort -v tail=10Time                   Value-------------------  -------2014-01-28 20:35:24     16402014-01-28 20:43:33     17002014-01-28 20:45:50     16802014-01-28 20:45:55     15802014-01-28 20:46:51     16602014-01-28 21:20:01     15802014-01-28 21:20:17     15902014-01-28 21:20:22     16802014-01-28 21:22:13     17402014-01-28 21:27:46     1730Reduce data::# Before reduceTitle                    Value-----------------------  --------------------------Sensorid                 domsrv:teleinfo:pappNB lines                 514671Min date                 2012-06-27 18:43:00Max date                 2014-01-25 10:27:15Min value                350 (2013-11-17 05:24:23)Max value                6710 (2013-08-07 20:57:14)Avg value                1301Avg delta (round ratio)  76Total size               6.3798828125 Mo# reduce with 80 delta value$ sk_command -a setproperty -s domsrv:teleinfo:papp -t ushort -v roundvalue=80$ sk_command -a reduce -s domsrv:teleinfo:papp -t ushort# Reduce resultTitle                    Value-----------------------  --------------------------Sensorid                 domsrv:teleinfo:pappNB lines                 107304Min date                 2012-06-27 18:43:00Max date                 2014-01-25 10:27:15Min value                350 (2013-12-21 11:22:21)Max value                6710 (2013-08-07 20:57:14)Avg value                1575Avg delta (round ratio)  302Total size               1.330078125 Mo**Compression ratio = 480%**You can also use the `serialkiller-plugins <https://github.com/badele/serialkiller-plugins>`_ for push the sensors results. See the `serialkiller-plugins example <https://github.com/badele/serialkiller-plugins/blob/master/README.rst#script-example>`_You can also point your web navigator to http://youipserver for list all JSON functions:::{"/": "All serialkiller API functions","/api/1.0/": "All serialkiller API functions","/api/1.0/addEvent/<sensorid>/<type>/<values>": "Add a new event, no deduplicate","/api/1.0/addValue/<sensorid>/<type>/<values>": "Add a new value, deduplicate line","/api/1.0/list": "List all last sensors"}You can also see the result directely in my personnal `website <http://domotique.adele.im>`_Changelog=========Version 0.0.2 (2014-02-08)--------------------------* Add skfloat type* Add unittest* Use supervisor for launch sk_server* Add sensor informations and reduce system* Lock file for concurent access* Replace chart.js by d3.js* Add metadata properties* Rename SerialKiller class to SensorVersion 0.0.1 (2013-12-29)--------------------------* First version