I don’t see a question? How I would do this is:
- create a scheduled event that runs every needed x seconds. Also create an entity with three attributes:
in this scheduled event create and commit an object of this type with setting its value and the CurrentDate as Timestamp.
- create your own logic by retrieving the correct list of objects from database to compare the different objects by its timestamp or retrieve the last x of them with the help of the auto number field and sorting