USM16 Improve Measurement Collection
Description
In this US it must be implemented the improve the flow of the measurements collection from the slave server, in order to provide reliability to the information collected and avoid data loss.
Tasks
-
Create a method in the Transductor (Energy Transductor) model that receives a datetime and makes a GET request, for each measurement type, in the range between the time of the last measurement of that type, collected and the datetime received and saves in the objects received in the master database.
Acceptance Criteria
-
Code have to be tested. -
Code according with codestyle tests. -
Before collecting must be confirmed the time synchrony between the master server and slave server. -
After collecting, the last measurement's timestamp must be saved in the transductor's 'last_data_collection' attribute. -
The range of the collection must start at the last collection date and end in the time that the collection stated. -
If the slave server can't communicate with the transductor, the attribute broken in the Transductor model must be set as true. -
If the master server can't communicate with the slave server, the attribute broken in the slaver server model must be set as true.