protected internal override void OnStatisticsEvent(StatisticsEventArgs args) { if (Parent != null) { Parent.OnStatisticsEvent(args); } }
/// <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; }
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 }); }
protected internal override void OnStatisticsEvent(StatisticsEventArgs args) { client.StatisticsEvent(args, CancellationToken.None).Wait(); }
protected internal override void OnStatisticsEvent(StatisticsEventArgs args) { MobileApp.OnStatisticsEvent(args); }
private void MicroserviceBff_StatisticsIssued(object sender, StatisticsEventArgs e) { }
protected override void OnStatisticsEvent(StatisticsEventArgs args) { Program.OnStatisticsEvent(args); }
//EVENTS*************************************************** private void OnAddedModifer(StatisticsEventArgs e) { //this.AddedModifer?.Invoke(this, e); }
protected override void OnStatisticsEvent(StatisticsEventArgs args) { Runner.OnStatisticsEvent(args); }
private void _model_StatisticsUpdated(object sender, StatisticsEventArgs e) { Lag = (int)e.Lag; }
public void SubscribeStatistics(StatisticsEventArgs statisticsEventArgs) { throw new NotImplementedException(); }
protected internal abstract void OnStatisticsEvent(StatisticsEventArgs args);
protected internal override void OnStatisticsEvent(StatisticsEventArgs args) { lock (locker) { Backend.OnStatisticsEvent(args); } }
private void OnRemoveModifer(StatisticsEventArgs e) { //this.RemovedModifer?.Invoke(this, e); }
private void OnRemovedAllModifers(StatisticsEventArgs e) { //this.RemovedAllModifers?.Invoke(this, e); }