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); }
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); }
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; }
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)); }
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); }