Ejemplo n.º 1
0
 /**
  * Increment the value by the specified amount.
  */
 internal void increment(double amount)
 {
     if (amount >= 0.0)
     {
         for (int i = 0; i < Pollers.NUM_POLLERS; ++i)
         {
             add(count.getCurrent(i), amount);
         }
     }
 }
Ejemplo n.º 2
0
        /**
         * Update the max for the given index if the provided value is larger than the current max.
         */
        private void updateMax(int idx, long v)
        {
            AtomicLong current = max.getCurrent(idx);
            long       m       = current.Value;

            while (v > m)
            {
                if (current.CompareAndSet(m, v))
                {
                    break;
                }
                m = current.Value;
            }
        }
Ejemplo n.º 3
0
 /**
  * Get the current count for the given poller index.
  */
 //@VisibleForTesting
 public long getCurrentCount(int pollerIndex)
 {
     return(count.getCurrent(pollerIndex).Value);
 }