Code example for AtomicLong

Methods: getAndAdd

0
      long t2 = System.currentTimeMillis();
      if (retval == null) {
         missTimes.getAndAdd(t2 - t1);
         misses.incrementAndGet();
      } else { 
         hitTimes.getAndAdd(t2 - t1);
         hits.incrementAndGet();
      } 
      return retval;
   } 
 
   @Override 
   public Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command) throws Throwable {
      Map data = command.getMap();
      long t1 = System.currentTimeMillis();
      Object retval = invokeNextInterceptor(ctx, command);
      long t2 = System.currentTimeMillis();
 
      if (data != null && !data.isEmpty()) {
         storeTimes.getAndAdd(t2 - t1);
         stores.getAndAdd(data.size());