Code example for Queue

Methods: clear

0
 
    public void reset() { 
        lastLatency.set(0);
        allTimeAvgLatency = 0.0;
        latencyDataQueue.clear();
        shortTermLatencyDataQueue.clear();
        longTermLatencyDataQueue.clear();
        count = 0;
        resetTime = Calendar.getInstance().getTime();
    } 
 
    public Date getLastResetTime() {
        return resetTime;
    } 
 
    private double getAverageLatencyByMinute(int n) {
        int samples = n * SAMPLES_PER_MINUTE;
        double sum = 0.0;
        Long[] array = shortTermLatencyDataQueue.toArray(new Long[shortTermLatencyDataQueue.size()]);
 
        if (samples > array.length) {