Code example for AtomicLong

Methods: addAndGet

0
     * Update the read statistics. 
     */ 
    public void updateReadStatistics(long latency)
    { 
        readOperations_.incrementAndGet();
        readLatencies_.addAndGet(latency);
    } 
 
    /** 
     * Update the write statistics. 
     */ 
    public void updateWriteStatistics(long latency)
    { 
        writeOperations_.incrementAndGet();
        writeLatencies_.addAndGet(latency);
    } 
}