コード例 #1
0
        public async override Task <ApiData> GetMinerStatsDataAsync()
        {
            var api            = new ApiData();
            var elapsedSeconds = DateTime.UtcNow.Subtract(_started).Seconds;

            if (elapsedSeconds < 15)
            {
                return(api);
            }

            var miningDevices  = _miningPairs.Select(pair => pair.Device).ToList();
            var algorithmTypes = IsDual() ? new AlgorithmType[] { _algorithmType, _algorithmSecondType } : new AlgorithmType[] { _algorithmType };
            // multiply dagger API data
            var ad = await ClaymoreAPIHelpers.GetMinerStatsDataAsync(_apiPort, miningDevices, _logGroup, DevFee, DualDevFee, algorithmTypes);

            var totalCount = ad.AlgorithmSpeedsTotal?.Count ?? 0;

            for (var i = 0; i < totalCount; i++)
            {
                ad.AlgorithmSpeedsTotal[i].Speed *= 1000; // speed is in khs
            }
            var keys = ad.AlgorithmSpeedsPerDevice.Keys.ToArray();

            foreach (var key in keys)
            {
                var devSpeedtotalCount = (ad.AlgorithmSpeedsPerDevice[key])?.Count ?? 0;
                for (var i = 0; i < devSpeedtotalCount; i++)
                {
                    ad.AlgorithmSpeedsPerDevice[key][i].Speed *= 1000; // speed is in khs
                }
            }
            return(ad);
        }
コード例 #2
0
ファイル: Phoenix.cs プロジェクト: rwalraven3/NiceHashMiner
        public async override Task <ApiData> GetMinerStatsDataAsync()
        {
            var miningDevices  = _orderedMiningPairs.Select(pair => pair.Device).ToList();
            var algorithmTypes = new AlgorithmType[] { _algorithmFirstType };
            // multiply dagger API data
            var ad = await ClaymoreAPIHelpers.GetMinerStatsDataAsync(_apiPort, miningDevices, _logGroup, DevFee, 0.0, algorithmTypes);

            var totalCount = ad.AlgorithmSpeedsTotal?.Count ?? 0;

            for (var i = 0; i < totalCount; i++)
            {
                ad.AlgorithmSpeedsTotal[i].Speed *= 1000; // speed is in khs
            }
            var keys = ad.AlgorithmSpeedsPerDevice.Keys.ToArray();

            foreach (var key in keys)
            {
                var devSpeedtotalCount = (ad.AlgorithmSpeedsPerDevice[key])?.Count ?? 0;
                for (var i = 0; i < devSpeedtotalCount; i++)
                {
                    ad.AlgorithmSpeedsPerDevice[key][i].Speed *= 1000; // speed is in khs
                }
            }
            return(ad);
        }
コード例 #3
0
ファイル: Phoenix.cs プロジェクト: zhamppx97/NiceHashMiner
 public async override Task<ApiData> GetMinerStatsDataAsync()
 {
     var miningDevices = _miningPairs.Select(pair => pair.Device).ToList();
     var algorithmTypes = new AlgorithmType[] { _algorithmType };
     // multiply dagger API data 
     var ad = await ClaymoreAPIHelpers.GetMinerStatsDataAsync(_apiPort, miningDevices, _logGroup, DevFee, 0.0, algorithmTypes);
     if (ad.AlgorithmSpeedsPerDevice != null)
     {
         // speed is in khs
         ad.AlgorithmSpeedsPerDevice = ad.AlgorithmSpeedsPerDevice.Select(pair => new KeyValuePair<string, IReadOnlyList<(AlgorithmType type, double speed)>>(pair.Key, pair.Value.Select((ts) => (ts.type, ts.speed * 1000)).ToList())).ToDictionary(x => x.Key, x => x.Value);
     }
     return ad;
 }
コード例 #4
0
        public async override Task <ApiData> GetMinerStatsDataAsync()
        {
            var api            = new ApiData();
            var elapsedSeconds = DateTime.Now.Subtract(_started).Seconds;

            if (elapsedSeconds < 15)
            {
                return(api);
            }

            var miningDevices  = _miningPairs.Select(pair => pair.Device).ToList();
            var algorithmTypes = new AlgorithmType[] { _algorithmType };

            return(await ClaymoreAPIHelpers.GetMinerStatsDataAsync(_apiPort, miningDevices, _logGroup, DevFee, 0.0, algorithmTypes));
        }
コード例 #5
0
        public async override Task <ApiData> GetMinerStatsDataAsync()
        {
            var api            = new ApiData();
            var elapsedSeconds = DateTime.UtcNow.Subtract(_started).Seconds;

            if (elapsedSeconds < 15)
            {
                return(api);
            }

            var miningDevices  = _miningPairs.Select(pair => pair.Device).ToList();
            var algorithmTypes = IsDual() ? new AlgorithmType[] { _algorithmType, _algorithmSecondType } : new AlgorithmType[] { _algorithmType };
            // multiply dagger API data
            var ad = await ClaymoreAPIHelpers.GetMinerStatsDataAsync(_apiPort, miningDevices, _logGroup, DevFee, DualDevFee, algorithmTypes);

            if (ad.AlgorithmSpeedsPerDevice != null)
            {
                // speed is in khs
                ad.AlgorithmSpeedsPerDevice = ad.AlgorithmSpeedsPerDevice.Select(pair => new KeyValuePair <string, IReadOnlyList <(AlgorithmType type, double speed)> >(pair.Key, pair.Value.Select((ts) => (ts.type, ts.speed * 1000)).ToList())).ToDictionary(x => x.Key, x => x.Value);
            }
            return(ad);
        }