CGI-FR / IoT-Hub-Portal

IoT Hub Portal is a solution for handling IoT Devices easily. It leverages on Azure IoT Hub / AWS IoT Core for connectivity and device management.
https://cgi-fr.github.io/IoT-Hub-Portal/stable/
MIT License
32 stars 12 forks source link

Feature: Custom metrics must up to date when change occurs on related data #857

Open hocinehacherouf opened 2 years ago

hocinehacherouf commented 2 years ago

Is your feature request related to a problem? Please describe. Currently, custom metrics are calculated each time interval (by default each 10 minutes). Between each iteration, these metrics can be outdated.

Describe the solution you'd like To keep custom metrics up to date: When a data has been created, updated, deleted, its related custom metric must be recalculated unitary

kbeaugrand commented 2 years ago

Actions :

hocinehacherouf commented 2 years ago

@kbeaugrand currently we use scheduled jobs to retrieve metrics about devices from azure iot hub. Some metrics can be queried from our database, other metrics can be retrieved only on azure iot hub.

I propose:

kbeaugrand commented 2 years ago

Saw in PBR.

No problem to synchronize the data during device sync job. Metrics might be taken directly from our database. Add the cache at the controller level.

This will make the settings around metrics job useless (important change not breaking).