Esempio n. 1
0
 private void torrent_ReportStatsChanged(object sender, StatsEventArgs e)
 {
     DownloadedBytes(e.BytesCompleted);
     chokedBy   = e.ChokedBy;
     totalPeers = e.TotalPeers;
     queued     = e.QueuedRequests;
 }
Esempio n. 2
0
 public void Update(StatsEventArgs e)
 {
     this.Cpu            = e.Cpu;
     this.Memory         = e.Memory;
     this.Players        = e.Players;
     this.PlayingPlayers = e.Players;
     this.Uptime         = e.Uptime;
 }
Esempio n. 3
0
 public void SetStats(StatsEventArgs e)
 {
     if (AudioStats == null)
     {
         AudioStats = new AudioStats(e);
     }
     else
     {
         AudioStats.Update(e);
     }
 }
Esempio n. 4
0
        public void StatsEventArgsConstructorTest()
        {
            const int wpm      = 40;
            const int errors   = 11;
            const int accuracy = 80;
            var       target   = new StatsEventArgs(wpm, errors, accuracy);

            Assert.AreEqual(wpm, target.WordsPerMinute);
            Assert.AreEqual(errors, target.Errors);
            Assert.AreEqual(accuracy, target.Accuracy);
        }
Esempio n. 5
0
        private void OnStatsReport()
        {
            if (Mode == null)
            {
                return;
            }

            var downloaded = Math.Min(Mode.BlockStrategist.Available * Global.Instance.BlockSize, Data.TotalLength);
            var totalPeers = Mode.Peers.Count;
            var chokedBy   = Mode.Peers.Count(p => p.Value.AmChoked);

            var stats = new StatsEventArgs(downloaded, totalPeers, chokedBy, 0);

            ReportStats?.Invoke(this, stats);
        }
Esempio n. 6
0
 private Task OnStatsReceived(StatsEventArgs arg)
 {
     Console.WriteLine($"Lavalink Uptime {arg.Uptime}.");
     return(Task.CompletedTask);
 }
Esempio n. 7
0
 public AudioStats(StatsEventArgs e)
 {
     this.Update(e);
 }
Esempio n. 8
0
 private Task OnStatsReceived(StatsEventArgs arg)
 {
     _logger.ConsoleMusicLog($"Lavalink Uptime {arg.Uptime}.");
     return(Task.CompletedTask);
 }
Esempio n. 9
0
 private Task OnStatsReceived([NotNull] StatsEventArgs arg)
 {
     this._logger.LogDebug($"Lavalink Uptime {arg.Uptime}.");
     return(Task.CompletedTask);
 }
Esempio n. 10
0
 private Task OnStatsReceived(StatsEventArgs arg)
 {
     _logger.LogInformation($"Lavalink has been up for {arg.Uptime}.");
     return(Task.CompletedTask);
 }
Esempio n. 11
0
 private void typingStats_StatsUpdated(object sender, StatsEventArgs obj)
 {
     this.Accuracy       = string.Concat(obj.Accuracy + "%");
     this.Errors         = obj.Errors.ToString(CultureInfo.CurrentCulture);
     this.WordsPerMinute = obj.WordsPerMinute.ToString(CultureInfo.CurrentCulture);
 }
Esempio n. 12
0
 private Task OnStatsReceived(StatsEventArgs e)
 {
     _log.LogTrace("Received Stats from LavaLink");
     _audioStatsService.SetStats(e);
     return(Task.CompletedTask);
 }
Esempio n. 13
0
 private Task OnStatsReceived(StatsEventArgs arg)
 => this.LogAsync(new LogMessage(LogSeverity.Info, "Victoria", $"Lavalink Uptime {arg.Uptime}.", null));
Esempio n. 14
0
 private void _torrent_ReportStats(object sender, StatsEventArgs e)
 {
     //Console.WriteLine(e.BytesCompleted);
     //Console.WriteLine(e.TotalPeers);
     //Console.WriteLine(e.ChokedBy);
 }
Esempio n. 15
0
 private void TorrentOnReportStats(object sender, StatsEventArgs statsEventArgs)
 {
 }
Esempio n. 16
0
 private Task OnStatsReceived(StatsEventArgs arg)
 {
     return(Task.CompletedTask);
 }