Exemple #1
0
 protected internal override void OnStatisticsEvent(StatisticsEventArgs args)
 {
     if (Parent != null)
     {
         Parent.OnStatisticsEvent(args);
     }
 }
Exemple #2
0
        /// <summary>
        /// Gets a pcap stat object and calculate bps and pps
        /// </summary>
        private static void device_OnPcapStatistics(object sender, StatisticsEventArgs e)
        {
            // Calculate the delay in microseconds from the last sample.
            // This value is obtained from the timestamp that's associated with the sample.
            ulong delay = (e.Timeval.Seconds - oldSec) * 1000000 - oldUsec + e.Timeval.MicroSeconds;

            // Get the number of Bits per second
            ulong bps = ((ulong)e.ReceivedBytes * 8 * 1000000) / delay;

            /*                                       ^       ^
             |       |
             |       |
             |       |
             |              converts bytes in bits --        |
             |
             |          delay is expressed in microseconds --
             */

            // Get the number of Packets per second
            ulong pps = ((ulong)e.ReceivedPackets * 1000000) / delay;

            // Convert the timestamp to readable format
            var ts = e.Timeval.Date.ToLongTimeString();

            // Print Statistics
            Console.WriteLine("{0}: bps={1}, pps={2}", ts, bps, pps);

            //store current timestamp
            oldSec  = e.Timeval.Seconds;
            oldUsec = e.Timeval.MicroSeconds;
        }
Exemple #3
0
 private void _connectionReceive_StatisticsUpdated(object sender, StatisticsEventArgs e)
 {
     App.Current.Dispatcher.Invoke((Action)(() =>
     {
         StatisticsUpdated?.Invoke(sender, e);
     }));
 }
 public void PopulatePieChartData(object sender, StatisticsEventArgs eventArgs)
 {
     if (eventArgs != null)
     {
         dynamic data = eventArgs.statistics.data;
         foreach (dynamic dataPoint in data)
         {
             pieChartData.Add((string)dataPoint.name, (float)dataPoint.sum);
         }
     }
     this.RunOnUiThread(() => plotView.Model = Statistics.pieChart(pieChartData));
 }
        public virtual void SubscribeStatistics(StatisticsEventArgs statisticsEventArgs)
        {
            var message = JsonConvert.SerializeObject(statisticsEventArgs.Statistics);

            var strategyNotification = new StrategyNotification {
                Name = Strategy.Name, Message = message, NotificationLevel = NotificationLevel.Statistics
            };

            StrategyStatisticsNotification(new StrategyNotificationEventArgs {
                StrategyNotification = strategyNotification
            });
        }
 public void PopulateLinearChartData(object sender, StatisticsEventArgs eventArgs)
 {
     if (eventArgs != null)
     {
         dynamic data = eventArgs.statistics.data;
         foreach (dynamic dataPoint in data)
         {
             linearChartData.Add(Convert.ToDateTime((string)dataPoint.date), (float)dataPoint.average_price);
         }
     }
     this.RunOnUiThread(() => plotView.Model = Statistics.linearChart(linearChartData));
 }
        public virtual void SubscribeStatistics(StatisticsEventArgs statisticsEventArgs)
        {
            if (statisticsEventArgs == null)
            {
                throw new ArgumentNullException(nameof(statisticsEventArgs));
            }

            var message = JsonConvert.SerializeObject(statisticsEventArgs.Statistics);

            var strategyNotification = new StrategyNotification {
                Name = Strategy.Name, Message = message, NotificationLevel = NotificationLevel.Statistics
            };

            StrategyStatisticsNotification(new StrategyNotificationEventArgs {
                StrategyNotification = strategyNotification
            });
        }
Exemple #8
0
 protected internal override void OnStatisticsEvent(StatisticsEventArgs args)
 {
     client.StatisticsEvent(args, CancellationToken.None).Wait();
 }
Exemple #9
0
 protected internal override void OnStatisticsEvent(StatisticsEventArgs args)
 {
     MobileApp.OnStatisticsEvent(args);
 }
 private void MicroserviceBff_StatisticsIssued(object sender, StatisticsEventArgs e)
 {
 }
Exemple #11
0
 protected override void OnStatisticsEvent(StatisticsEventArgs args)
 {
     Program.OnStatisticsEvent(args);
 }
Exemple #12
0
 //EVENTS***************************************************
 private void OnAddedModifer(StatisticsEventArgs e)
 {
     //this.AddedModifer?.Invoke(this, e);
 }
Exemple #13
0
 protected override void OnStatisticsEvent(StatisticsEventArgs args)
 {
     Runner.OnStatisticsEvent(args);
 }
Exemple #14
0
 private void _model_StatisticsUpdated(object sender, StatisticsEventArgs e)
 {
     Lag = (int)e.Lag;
 }
Exemple #15
0
 public void SubscribeStatistics(StatisticsEventArgs statisticsEventArgs)
 {
     throw new NotImplementedException();
 }
Exemple #16
0
 protected internal abstract void OnStatisticsEvent(StatisticsEventArgs args);
Exemple #17
0
 protected internal override void OnStatisticsEvent(StatisticsEventArgs args)
 {
     lock (locker) {
         Backend.OnStatisticsEvent(args);
     }
 }
Exemple #18
0
 private void OnRemoveModifer(StatisticsEventArgs e)
 {
     //this.RemovedModifer?.Invoke(this, e);
 }
Exemple #19
0
 private void OnRemovedAllModifers(StatisticsEventArgs e)
 {
     //this.RemovedAllModifers?.Invoke(this, e);
 }