Ejemplo n.º 1
0
 /// <summary>
 /// Marks the occurrence of an operation.
 /// </summary>
 /// <param name="n">N.</param>
 public virtual void Mark(long n = 1)
 {
     _counter.AddAndGet(n);
     _m1Rate.Update(n);
     _m5Rate.Update(n);
     _m15Rate.Update(n);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Adds a value to counter.
        /// </summary>
        /// <param name="value">A long value to add to the counter.</param>
        public virtual void Add(long value)
        {
            _value.AddAndGet(value);

            _iterations.Increment();

            if (_directWrite && (_iterations.Get() % _resolution) == 0)
            {
                Write();
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 ///  Update the moving average with a new value.
 /// </summary>
 /// <param name="n"></param>
 public void Update(long n)
 {
     _uncounted.AddAndGet(n);
 }