/// <summary>
 /// Sets the total document count.
 /// </summary>
 /// <param name="totalDocumentCount">The total document count.</param>
 private void SetTotalDocumentCount(int totalDocumentCount)
 {
     if (WorkerStatistics == null)
     {
         return;
     }
     WorkerStatistics.PunchInNet();
     WorkerStatistics.SetTotalDocumentCount(totalDocumentCount);
     WorkerStatistics.PunchOutNet();
     WorkerStatistics.Send();
 }
        private bool GenerateMessageNetTimed()
        {
            bool completed;

            try
            {
                //Tracer.Trace("First Worker {0} processing message", WorkerId);
                WorkerStatistics.PunchInNet();
                completed = GenerateMessage();
                //Tracer.Trace("First Worker {0} processed message", WorkerId);
            } finally
            {
                WorkerStatistics.PunchOutNet();
            }
            return(completed);
        }
 private void ProcessMessageNetTimed(PipeMessageEnvelope message)
 {
     //long envelopeSize = Utils.BinSizeOf(message);
     //long bodySize = Utils.BinSizeOf(message.Body);
     //Tracer.Trace("Worker {0} received message of the size {1}/{2}", WorkerId, envelopeSize, bodySize);
     try
     {
         //Tracer.Trace("Worker {0} processing message", WorkerId);
         WorkerStatistics.PunchInNet();
         ProcessMessage(message);
         //Tracer.Trace("Worker {0} processed message", WorkerId);
     }
     finally
     {
         WorkerStatistics.PunchOutNet();
         WorkerStatistics.RecordInputTraffic(message);
     }
 }