when changing metrics we need a write lock