diff options
author | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-06-14 22:02:35 +0200 |
---|---|---|
committer | Sebastien Douheret <sebastien.douheret@iot.bzh> | 2018-07-10 23:59:54 +0200 |
commit | 5d0e551a25edeba7df7f64b1370bad7558b9b2f1 (patch) | |
tree | 61b52a784c21cb81836e1475c185f9b0574002f3 /README.md | |
parent | 75eb2161c641f85dded64a99cb862abfab64eff7 (diff) |
Update trace event name and add grafana config
Change-Id: Id369702240b10c756ffa743309e574b2e0ed28ec
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 71 |
1 files changed, 61 insertions, 10 deletions
@@ -15,7 +15,7 @@ cd agl-server-xds ## Build for AGL ```bash -#setup your build environement +#setup your build environment . /xdt/sdk/environment-setup-aarch64-agl-linux #build your application ./conf.d/autobuild/agl/autobuild package @@ -33,24 +33,75 @@ You can also use binary package from OBS: [opensuse.org/LinuxAutomotive][opensus ### Native setup -Here are commands used to setup some bindings in order to test on `xds-service` natively on a Linux host: +Here are commands used to build and setup some AGL services/bindings in order to test on `xds` service natively on a Linux host. + +#### Build ```bash -afs-supervisor --port 1712 --token HELLO --ws-server=unix:/tmp/supervisor -vv +cd $ROOT_DIR/agl-service-xds +./conf.d/autobuild/linux/autobuild build +``` -cd $ROOT_DIR/app-framework-binder -afb-daemon -t '' -p 5555 -M --roothttp test --ws-server unix:ave --name test_server -vv -afb-daemon -t '' -p 4444 -M --roothttp test --no-ldpaths --ws-client unix:ave --name test_client -vv +#### Run services/bindings +```bash +# Setup supervisor to supervise AGL system +afs-supervisor --port 1712 --token HELLO --ws-server=unix:/tmp/supervisor -vv + +# Start harverster to save data in a TSDB cd $ROOT_DIR/agl-service-harvester -afb-daemon --port=1234 --workdir=./build/package --ldpaths=lib --roothttp=htdocs --token= --tracereq=common -vv --ws-server unix:/tmp/harvester +afb-daemon --port=1234 --name=afb-harvester --workdir=./build/package --ldpaths=lib --roothttp=htdocs --token= --tracereq=common --ws-server unix:/tmp/harvester -vv +# Start XDS collector to control supervisor cd $ROOT_DIR/agl-service-xds -./conf.d/autobuild/linux/autobuild build -afb-daemon --port=5678 --name=afb-xds --workdir=./build/package --ldpaths=lib --roothttp=htdocs --token=1977 --ws-client=unix:/tmp/supervisor --ws-client=unix:/tmp/harvester -vv +afb-daemon --port=5678 --name=afb-xds --workdir=./build/package --ldpaths=lib --roothttp=htdocs --token= --ws-client=unix:/tmp/supervisor --ws-client=unix:/tmp/harvester -vvv +``` + +**Example 1** : Demo based on simple helloworld AGL service + +``` bash +cd $ROOT_DIR/app-framework-binder +afb-daemon -t '' -p 5555 -M --roothttp test --ws-server unix:ave --name test_server -vvv +afb-daemon -t '' -p 4444 -M --roothttp test --no-ldpaths --ws-client unix:ave --name test_client -vvv + +# Get bindings list +afb-client-demo --raw 'localhost:5678/api?token=1977&uuid=magic' xds list | jq .response[].pid + +# Request monitoring of socket "unix:ave" +afb-client-demo 'localhost:5678/api?token=HELLO&uuid=c' xds trace '{"ws":"unix:ave"}' + +# Call ping verb of hello api (should be spy by supervision/monitoring) +afb-client-demo 'localhost:5555/api?token=toto&uuid=magic' hello ping + +# Same call some other verbs of hello api +afb-client-demo 'localhost:5555/api?token=toto&uuid=magic' hello eventadd '{"tag":"x","name":"event"}' +afb-client-demo 'localhost:5555/api?token=toto&uuid=magic' hello eventsub '{"tag":"x"}' +afb-client-demo 'localhost:5555/api?token=toto&uuid=magic' hello eventpush '{"tag":"x","data":true}' + +# Dump data from TSDB +influx -database 'agl-garner' -execute 'show series' +influx -database 'agl-garner' -execute 'select * from "xds/supervisor/trace"' ``` -afb-client-demo -H 'localhost:5678/api?token=1977&uuid=magic' xds list +**Example 2**: Demo based on AGL mockup services + +```bash +# Monitor AGL mockup services +cd $ROOT_DIR/agl-services-mockup && start_agl_mockup.sh 1 +# ... at this point script stop and wait user... + +# In another shell, execute following commands to request monitoring of can_emul and gps_emul sockets +afb-client-demo 'localhost:5678/api?token=HELLO&uuid=c' xds trace '{"ws":"can_emul"}' +afb-client-demo 'localhost:5678/api?token=HELLO&uuid=c' xds trace '{"ws":"gps_emul"}' + +# Press any key in 1 shell to continue start_agl_mockup.sh script + +# Dump data from TSDB +influx -database 'agl-garner' -execute 'select * from "xds/supervisor/trace"' + +# Drop data +# influx -database 'agl-garner' -execute 'drop measurement "xds/supervisor/trace"' +``` ## Deploy |