Code example for AtomicLong

Methods: get, set

0
        if(writeLatencyRecord != null)
        { 
            if ( writeOperations_.get() > 0 )
            { 
                writeLatencyRecord.setTag(TAG_WRITEAVG, TAG_WRITE_AVG);
                writeLatencyRecord.setMetric(METRIC_WRITE_AVG, writeLatencies_.get() / writeOperations_.get() );
                writeLatencyRecord.update();
            } 
        } 
 
        clear(); 
    } 
 
    /** 
     * Reset all the metric records 
     */ 
    private void clear() 
    { 
        readOperations_.set(0);
        readLatencies_.set(0);
        writeOperations_.set(0);
        writeLatencies_.set(0);
    } 
 
    /** 
     * Update the read statistics. 
     */