/// <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);
 }
Exemple #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();
            }
        }
 /// <summary>
 ///  Update the moving average with a new value.
 /// </summary>
 /// <param name="n"></param>
 public void Update(long n)
 {
     _uncounted.AddAndGet(n);
 }