Esempio n. 1
0
        private void AddHistoryItem(FixedSizeQueue <DiskActivityStatQueue> from, int count, FixedSizeQueue <DiskActivityStatQueue> to, long index)
        {
            if (from.Count() < count)
            {
                return;
            }
            double read  = 0;
            double write = 0;

            for (int i = 1; i <= count; i++)
            {
                DiskActivityStatQueue sample = from.ElementAt(history.Count() - i);
                read  += sample.read;
                write += sample.write;
            }
            read  /= count;
            write /= count;

            var hourSample = new DiskActivityStatQueue
            {
                SampleID  = index,
                read      = read,
                write     = write,
                readIOPS  = 0,
                writeIOPS = 0
            };

            to.Enqueue(hourSample);
        }
Esempio n. 2
0
        public void Update(long historyIndex)
        {
            var read      = diskRead.NextValue();
            var write     = diskWrite.NextValue();
            var readIOPS  = diskIOPSRead.NextValue();
            var writeIOPS = diskIOPSWrite.NextValue();

            var ns = new DiskActivityStatQueue
            {
                read      = read,
                write     = write,
                readIOPS  = readIOPS,
                writeIOPS = writeIOPS,
                SampleID  = historyIndex
            };

            history.Enqueue(ns);
        }
        private void AddHistoryItem(FixedSizeQueue<DiskActivityStatQueue> from, int count, FixedSizeQueue<DiskActivityStatQueue> to, long index)
        {
            if (from.Count() < count)
                return;
            double read = 0;
            double write = 0;
            for (int i = 1; i <= count; i++)
              		{
              			DiskActivityStatQueue sample = from.ElementAt(history.Count() - i);
                read += sample.read;
                write += sample.write;
              		}
            read /= count;
            write /= count;

            var hourSample = new DiskActivityStatQueue
            {
                SampleID = index,
                read = read,
                write = write,
                readIOPS = 0,
                writeIOPS = 0
            };
            to.Enqueue(hourSample);
        }
        public void Update(long historyIndex)
        {
            var read = diskRead.NextValue();
            var write = diskWrite.NextValue();
            var readIOPS = diskIOPSRead.NextValue();
            var writeIOPS = diskIOPSWrite.NextValue();

              			var ns = new DiskActivityStatQueue
            {
                read = read,
                write = write,
                readIOPS = readIOPS,
                writeIOPS = writeIOPS,
                SampleID = historyIndex
            };
            history.Enqueue(ns);
        }