Пример #1
0
        public void CreateRanges(int[] secRanges, FlushCB f = null)
        {
            currentRanges = new StatRange[secRanges.Length];
            lastRanges = new StatRange[secRanges.Length];
            for (int i = 0; i < secRanges.Length; i++)
            {
                lastRanges[i] = currentRanges[i] = new StatRange(secRanges[i]);
            }

            flushCallback = f;
        }
Пример #2
0
        public void CreateRanges(int[] secRanges, MongoRange[] pranges, FlushCB f = null)
        {
            currentRanges = new StatRange[secRanges.Length];
            lastRanges = new StatRange[secRanges.Length];
            for (int i = 0; i < secRanges.Length; i++)
            {
                StatRange sr = new StatRange(secRanges[i]);
                for (int j = 0; j < pranges.Length; j++)
                {
                    if (pranges[j].SecondsInterval == secRanges[i])
                    {
                        sr.Restore(pranges[j]);
                        break;
                    }
                }
                lastRanges[i] = currentRanges[i] = sr;
            }

            flushCallback = f;
        }
Пример #3
0
 public StatRange(StatRange prev)
     : this(prev.secondsInterval, prev.NextLeft)
 {
 }
Пример #4
0
        private StatRange FlushExpired(int i, StatRange r)
        {
            if (r.Expired)
            {
                // flush and create new
                if (flushCallback != null)
                    flushCallback(r, this.MatchData);

                logger.Info("{0} {1}/{2}sec.", matchString(), r.Counter, r.secondsInterval);
                lastRanges[i] = r;
                r = currentRanges[i] = new StatRange(r);
            }
            return r;
        }
Пример #5
0
 public StatRange(StatRange prev)
     : this(prev.secondsInterval, prev.NextLeft)
 {
 }