Esempio n. 1
0
        public void ReportTransferSpeedEvent(Node node, TransferSpeedType type, long value)
        {
            INodeStats stats = GetOrAdd(node);

            stats.AddTransferSpeedCaptureEvent(type, value);
        }
Esempio n. 2
0
        public void TransferSpeedCaptureTest(TransferSpeedType speedType)
        {
            _nodeStats = new NodeStatsLight(_node);

            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 30);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 51);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 140);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 110);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 133);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 51);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 140);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 110);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 133);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 51);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 140);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 110);
            _nodeStats.AddTransferSpeedCaptureEvent(speedType, 133);

            var av = _nodeStats.GetAverageTransferSpeed(speedType);

            Assert.AreEqual(102, av);

            var paddedAv = _nodeStats.GetPaddedAverageTransferSpeed(speedType);

            Assert.AreEqual("  102", paddedAv);
        }
Esempio n. 3
0
        public void TransferSpeedCaptureTest()
        {
            _nodeStats = new NodeStatsLight(_node, _config);

            _nodeStats.AddTransferSpeedCaptureEvent(30);
            _nodeStats.AddTransferSpeedCaptureEvent(51);
            _nodeStats.AddTransferSpeedCaptureEvent(140);
            _nodeStats.AddTransferSpeedCaptureEvent(110);
            _nodeStats.AddTransferSpeedCaptureEvent(133);
            _nodeStats.AddTransferSpeedCaptureEvent(51);
            _nodeStats.AddTransferSpeedCaptureEvent(140);
            _nodeStats.AddTransferSpeedCaptureEvent(110);
            _nodeStats.AddTransferSpeedCaptureEvent(133);
            _nodeStats.AddTransferSpeedCaptureEvent(51);
            _nodeStats.AddTransferSpeedCaptureEvent(140);
            _nodeStats.AddTransferSpeedCaptureEvent(110);
            _nodeStats.AddTransferSpeedCaptureEvent(133);

            var av = _nodeStats.GetAverageTransferSpeed();

            Assert.AreEqual(102, av);
        }