Set up and run
Create an access key.
Add your Device Management
mbed_cloud_dev_credentials.cfile from Device Management Portal.
mbed_cloud_dev_credentials.cfile to the
Run the following in the root of your project:
docker-compose build docker-compose up --scale linux_client=3
This spins up four items:
- Three Linux client instances, each generating a data stream simulating a product on a shelf.
- The proxy web application for pushing the data stream from Device Management to InfluxDB.
- An InfluxDB instance.
- Grafana, where all the data aggregation and visualization happens.
To use Grafana to configure a visualization platform for analytics, go to
http://localhost:3001. The login credentials are admin, admin.
To add the Influx DB data source, select
InfluxDBfrom the dropdown list.
http://influxdb:8086. Docker automatically handles the resolution from InfluxDB to its URL according to its label in the
- DB: example
- Username: root
- Pass: root
To add a dashboard:
- Create a graph.
- Select edit on the graph title.
- Go to metrics and add the following:
field(count) count() non_negative_difference()
- GROUP BY:
time(1s) tag(product_id) fill(previous)
- ALIAS BY:
This metric determines the level of product activity by first counting the number of interactions with a product (product taken, product returned) in a one-second interval. This is useful in understanding how much activity a particular shelf has. Additionally, computing the non-negative difference between the values gives insight into how consistent they are, and roughly translates to the velocity of product activity on a shelf.
Shutting down the application
Shut down the application with
Ctrl-Z and either:
Bring down the docker containers in the working directory with
Destroy the containers and delete persistent storage of saved TSDB values with
docker-compose down -v.