ROSE-AP of the FlexHex project tries to make data gathering from Orion Context Broker entities to influx-db easier.
This project is part of DIH^2. For more information check the RAMP Catalogue entry for the components.
📚 Documentation |
---|
📼 Step-by-step tutorial video |
---|
Data gathering can be cumbersome sometimes. This module tries to solve and simplify it. To make data gathering to influx-db a bit easier.
It tries to do so via WEB interface and for more advanced use cases - API.
Currently there are four main parts that user/operator can control:
- Measurements - Measurement to be processed from incoming Orion Context Broker subscription data and uploaded into influx-db. User defines entities and their types for the Orion Context Broker subscription. Also fields and tags to gather from the Orion Context Broker entity.
- Buckets - Used to define buckets of the influx-db. Allows to assign different measurements.
- Organizations - Used to define organizations of the influx-db. Allows to assign different buckets.
- Subscriptions - Used to control selected measurement subscription. CRUD (Create, read, update and delete) principle. Main use case - automatically form the required subscription for the selected measurement and post it to Orion Context Broker.
It is based on Orion Context Broker entities and subscriptions, and is NGSIv2 compliant to process the incoming data into Line Protocol for influx-db.
Information about architecture of the FlexHex ROSE-AP can be found in the Architecture documentation.
How to install the component
Information about how to install the FlexHex ROSE-AP can be found at the corresponding section of the Installation & Administration Guide.
How to use the component
Information about how to get started using the FlexHex ROSE-AP can be found in the Getting Started guide.
Information about how to use the FlexHex ROSE-AP can be found in the Step-by-step guide.
Information about the API of the FlexHex ROSE-AP can be found in the API documentation.
For now, API tests are available.
They are done using python module "pytest" and for coverage "coverage".
To install the modules, you need Python 3. Python3.7+ recommended. You can get python here. Also, python packet manager pip is required.
Installing pytest and coverage:
-
pip3 install pytest
-
pip3 install coverage
docker-compose
.
FlexHex-Rose-AP/API/app/.env
file IP addresses to your machine IP address.
Navigate to app directory inside terminal or open terminal in the directory:
cd FlexHex-Rose-AP/API/app
Run pytest:
-
pytest
It will gather all tests available and it will run them. All of the tests are currently inside
FlexHex-Rose-AP/API/app/test_main.py
module.After few moments, there should be logs appearing with the status of tests and finally the result will be displayed if everything was successful or not and why.
Navigate to app directory inside terminal or open terminal in the directory:
cd FlexHex-Rose-AP/API/app
Run coverage:
-
coverage run -m pytest
Coverage will run pytest and it will collect metrics in the background.
Get coverage report:
-
coverage report
It will display a table representing statements in files and how many of those statements are not covered by tests and the coverage of tests in percentage.
Get coverage report in a HTML file:
-
coverage html
This will create
htmlcov
directory insideFlexHex-Rose-AP/API/app
. Inside, locate and openindex.html
in your browser.If everything was successful, there should be interactive report that will display lines where tests don't cover statements, percentage of coverage, excluded statements.
Apache 2.0 © Factobotics