summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-05-18 15:40:40 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2018-07-10 23:41:14 +0200
commitf98442442edcd2a0a06ed3616e1fdd4399056b31 (patch)
treee3e32b908b75dd2228bce466866c9bd4fb72ea87
parent611c2f4a09c0e803c8c9fa1bf26b59e9ab607d71 (diff)
Added a quickstart README
Change-Id: I75097671a20e20817a95ec6b857f78c91f93d3b1 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--README.md67
1 files changed, 67 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..af77240
--- /dev/null
+++ b/README.md
@@ -0,0 +1,67 @@
+# README
+
+## Installation
+
+```bash
+git clone --recurse-submodules https://github.com/iotbzh/agl-service-harvester.git
+cd agl-service-harvester.git
+mkdir build && cd build
+cmake .. && make
+```
+
+## Usage
+
+Typical example to write in a TimeSeries DB from source project directory:
+
+```bash
+$ cd build/package/ && /opt/AGL/bin/afb-daemon --workdir=. --name=afbd-harvester --ldpaths=lib --roothttp=. --tracereq=common --token=1 -vvv
+[...]
+$ afb-client-demo ws://localhost:1234/api?token=1
+harvester auth
+ON-REPLY 1:harvester/write: {"jtype":"afb-reply","request":{"status":"success", "uuid":"03dc89fb-88b4-4204-ba9b-13dded3c38ab"}}
+
+harvester write {"metric": [{"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 0},"timestamp": 1526048390725229811}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 1},"timestamp": 1526048590732571963}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 2},"timestamp": 1526048790741053301}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 3},"timestamp": 1526049390746492374}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 4},"timestamp": 1526049590753850373}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 5},"timestamp": 1526049790760449841}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 6},"timestamp": 1526049990768334799}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 7},"timestamp": 1526052290774058754}, {"name": "engine_speed","metadata": {"source": "my_source","identity": "claneys"},"values": {"value": 8},"timestamp": 1526055590781866679}]}
+
+ON-REPLY 2:harvester/write: {"jtype":"afb-reply","request":{"status":"success","info":"Request has been successfully writen"}}
+```
+
+## InfluxDB check
+
+```bash
+sudo systemctl start influxdb
+```
+
+Check a measurement:
+
+```bash
+$ influx
+Connected to http://localhost:8086 version 1.5.1
+InfluxDB shell version: 1.5.1
+> use agl-garner
+Using database agl-garner
+> select value_f from engine_speed
+name: engine_speed
+time value_f
+---- -------
+1526643129561864049 0
+1526643129561873378 1
+1526643129561877058 2
+1526643129561879981 3
+1526643129561882627 4
+1526643129561885153 5
+1526643129561888066 6
+1526643129561891514 7
+1526643129561893920 8
+> exit
+```
+
+Drop measurement:
+
+```bash
+influx
+Connected to http://localhost:8086 version 1.5.1
+InfluxDB shell version: 1.5.1
+> use agl-garner
+Using database agl-garner
+> drop measurement engine_speed
+```