Walmart is considered a barometer of consumer spending given its vast customer base.

Walmart shares fell 8% despite strong second-quarter results, with revenue rising 5.9%, e-commerce sales jumping 23% and operating income increasing 28.8%. Investors focused on…