GetMaxUpdater() public method

public GetMaxUpdater ( HystrixRollingNumberEvent type ) : LongMaxUpdater
type HystrixRollingNumberEvent
return LongMaxUpdater
コード例 #1
0
 public void AddBucket(Bucket lastBucket)
 {
     foreach (HystrixRollingNumberEvent type in HystrixRollingNumberEventHelper.Values)
     {
         if (HystrixRollingNumberEventHelper.IsCounter(type))
         {
             GetAdder(type).Add(lastBucket.GetAdder(type).Sum());
         }
         if (HystrixRollingNumberEventHelper.IsMaxUpdater(type))
         {
             GetMaxUpdater(type).Update(lastBucket.GetMaxUpdater(type).Max);
         }
     }
 }
コード例 #2
0
            /// <summary>
            /// Updates the cumulative values by the values of a <see cref="Bucket"/>.
            /// </summary>
            /// <param name="lastBucket">The bucket to update with.</param>
            public void AddBucket(Bucket lastBucket)
            {
                foreach (HystrixRollingNumberEvent type in HystrixRollingNumberEventExtensions.Values)
                {
                    if (type.IsCounter())
                    {
                        this.GetAdder(type).Add(lastBucket.GetAdder(type).Sum());
                    }

                    if (type.IsMaxUpdater())
                    {
                        this.GetMaxUpdater(type).Update(lastBucket.GetMaxUpdater(type).Max());
                    }
                }
            }
コード例 #3
0
        internal long GetValueOfLatestBucket(RollingNumberEvent ev)
        {
            Bucket lastBucket = GetCurrentBucket();

            if (lastBucket == null)
            {
                return(0);
            }
            // we have bucket data so we'll return the lastBucket
            if ((int)ev > (int)RollingNumberEvent.MAX_COUNTER)
            {
                return(lastBucket.GetMaxUpdater(ev));
            }
            else
            {
                return(lastBucket.GetAdder(ev));
            }
        }
コード例 #4
0
ファイル: RollingNumber.cs プロジェクト: Elders/Ares
            /// <summary>
            /// Updates the cumulative values by the values of a <see cref="Bucket"/>.
            /// </summary>
            /// <param name="lastBucket">The bucket to update with.</param>
            public void AddBucket(Bucket lastBucket)
            {
                foreach (RollingNumberEvent type in RollingNumberEventExtensions.Values)
                {
                    if (type.IsCounter())
                    {
                        this.GetAdder(type).Add(lastBucket.GetAdder(type).Sum());
                    }

                    if (type.IsMaxUpdater())
                    {
                        this.GetMaxUpdater(type).Update(lastBucket.GetMaxUpdater(type).Max());
                    }
                }
            }