Refactoring synchronization blocks keeping ordering of execution intact
问题 I have this synchronized block in one of my classes, whose main responsibility is to capture metrics around service calls. All variables prefixed with _ are class variables and are primitive longs. I am looking to refactor this synchronized block so as to increase the throughput, but keeping the overall accuracy intact. I have a test setup which calls this method from Runnable threads using an executor service. I am doing a comparison on the metrics before and after refactoring. public