Allowed turning off network socket statistics collection.

Review: https://reviews.apache.org/r/28295