private void ReadGroupOfBuffersFromFile(FileStream fs, Histogram perBuffer)
        {
            try
            {
                QpcTimeStamp now = QpcTimeStamp.Now;
                QpcTimeStamp perGroupStartTime = now;

                for (int groupIdx = 0; groupIdx < numReadBuffersPerGroup; groupIdx++)
                {
                    byte[] buffer = readBufferArray[nextReadBufferSelect];
                    nextReadBufferSelect = (nextReadBufferSelect + 1) % numReadBuffers;

                    nextReadOffset = (nextReadOffset + bufferSize * readStride) % fileSize;

                    QpcTimeStamp perBufferStartTime = now;

                    fs.Seek(nextWriteOffset, SeekOrigin.Begin);
                    fs.Read(buffer, 0, bufferSize);

                    perBuffer.Add((now.SetToNow() - perBufferStartTime).TotalSeconds);
                }
            }
            catch (System.Exception ex)
            {
                Log.Debug.Emit("{0} generated unexpected exception: {1}", CurrentMethodName, ex.ToString(ExceptionFormat.TypeAndMessage));
            }
        }
Example #2
0
            public void SetState(State nextState, string reason)
            {
                State entryState = state;

                state = nextState;
                stateTimeStamp.SetToNow();

                if (state != entryState)
                {
                    Logger.Trace.Emit("{0}: State is now {1} [from {2}]", portConfig.Name, state, entryState);
                }
            }
Example #3
0
 public PingUserToken SetToNow()
 {
     sendTimeStamp.SetToNow(); return(this);
 }