@coderBear I don't the code works in concurrent situation. the simple way for multi-thread is adding synchronized: public synchronized void hit(...) and public synchronized int getHits(...). you may wonder the performance impact. No doubt, the two method are able to handle trillions of requests per day!
Design Hit Counter