Beispiel #1
0
 VgcApis.Models.Datas.StatsSample TakeStatisticsSample(int port)
 {
     if (!setting.isEnableStatistics || port <= 0)
     {
         return(null);
     }
     return(v2rayCore.QueryStatsApi(port));
 }
Beispiel #2
0
        void RecordStatSample()
        {
            if (!setting.isEnableStatistics ||
                !IsCoreRunning() ||
                setting.IsScreenLocked() ||
                setting.IsClosing() ||
                !isRecording.Install())
            {
                return;
            }

            try
            {
                var statsPort = coreStates.GetStatPort();
                if (statsPort > 0)
                {
                    var sample = v2rayCore.QueryStatsApi(statsPort);
                    coreStates.AddStatSample(sample);
                }
            }
            catch { }
            isRecording.Remove();
        }