예제 #1
0
 /// <summary>
 /// Create a new statistic instance and load all members from
 /// another one.
 /// </summary>
 /// <param name="other">The origin of the counters. Access to
 /// all memebers will by synchronized.</param>
 public PinStatistics(PinStatistics other)
 {
     // Read out
     lock (other.m_Lock)
     {
         // All
         SampleCount   = other.SampleCount;
         SampleTotal   = other.SampleTotal;
         SampleMinSize = other.SampleMinSize;
         SampleMaxSize = other.SampleMaxSize;
     }
 }
예제 #2
0
 /// <summary>
 /// Create a new statistic instance and load all members from 
 /// another one.
 /// </summary>
 /// <param name="other">The origin of the counters. Access to
 /// all memebers will by synchronized.</param>
 public PinStatistics( PinStatistics other )
 {
     // Read out
     lock (other.m_Lock)
     {
         // All
         SampleCount = other.SampleCount;
         SampleTotal = other.SampleTotal;
         SampleMinSize = other.SampleMinSize;
         SampleMaxSize = other.SampleMaxSize;
     }
 }
예제 #3
0
        /// <summary>
        /// Beendet einen Verbraucher.
        /// </summary>
        /// <param name="pid">Die gewünschte Datenstromlennung.</param>
        public void StopFilter(ushort pid)
        {
            // Check statistics
            if (EnableStatistics)
            {
                // Load
                PinStatistics statistics = GetStatistics(pid);
                if (null != statistics)
                {
                    if (statistics.SampleCount > 0)
                    {
                        Dump("[{0:00000}] #{1} {2} ([{3}..{4}] {5})", pid, statistics.SampleCount, statistics.SampleTotal, statistics.SampleMinSize, statistics.SampleMaxSize, statistics.BytesPerSample);
                    }
                }
            }

            // Deregister
            m_Parser.RemoveFilter(pid);
        }
예제 #4
0
        /// <summary>
        /// Ermittelt die Durchflussdaten zu einem Teildatenstrom.
        /// </summary>
        /// <param name="pid">Die Datenstromkennung.</param>
        /// <returns>Die Informationen zu dem Teildatenstrom.</returns>
        public PinStatistics GetStatistics(ushort pid)
        {
            // Create
            var result = new PinStatistics();

            // Load
            var filter = m_Parser[pid];

            if (filter != null)
            {
                // Fill
                result.SampleMinSize = filter.MinimumPacketSize;
                result.SampleMaxSize = filter.MaximumPacketSize;
                result.SampleCount   = filter.PacketCount;
                result.SampleTotal   = filter.TotalBytes;
            }

            // Done
            return(result);
        }