Added new unit test to cover different uptime calculation cases. Also
fetch all usage events for calculation.