cache numbeats calculation

Signed-off-by: Felix Dumit <felix.dumit@gmail.com>