Measuring resilience to energy shocks