mercredi 19 avril 2017

Calculation of Uptime from SQL database

I have bunch of client device that send alive packet periodically to the server. In server, Java application put these packets to MySQL database with timestamp. Sometimes some of the alive packet shouldn't arrive database. What I want to do is, calculate the uptime (application start time) of particular client device. If the client device shouldn't send 3 alive packet in row, it accepted as a dead device .

What I thought is, set the uptime in application for each device to application start time, and check periodically to database. I'm not sure this is right way.

What is the idiom to calculate uptime for a device for given circumstances?

Aucun commentaire:

Enregistrer un commentaire