add batch writes in cache.

In this PR, batch writes is added to the in memory cache as mentioned in #182
Since the UI queries every second, we will end up invoking Flush() every second which defeats the purpose of buffering. We should we get rid of percentiles from basic ContainerInfo before making this change.