Time metrics aggregation, supported by mongodb and nodejs