Class Meter


  • public class Meter
    extends java.lang.Object
    A Meter implementation based on AtomicLong
    Author:
    Daniel Meyer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.atomic.AtomicLong counter  
      protected java.lang.String name  
    • Constructor Summary

      Constructors 
      Constructor Description
      Meter​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long get()  
      long get​(boolean clear)  
      long getAndClear()  
      java.lang.String getName()  
      void mark()  
      void markTimes​(long times)  
      void setName​(java.lang.String name)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • counter

        protected java.util.concurrent.atomic.AtomicLong counter
      • name

        protected java.lang.String name
    • Constructor Detail

      • Meter

        public Meter​(java.lang.String name)
    • Method Detail

      • mark

        public void mark()
      • markTimes

        public void markTimes​(long times)
      • getName

        public java.lang.String getName()
      • setName

        public void setName​(java.lang.String name)
      • getAndClear

        public long getAndClear()
      • get

        public long get​(boolean clear)
      • get

        public long get()