minermedic/miner_results.py
def populate_miner_results(self, miner, elapsed_secs, worker, algo, pool, chips,
                               temps, fan_speeds, hashrate_ghs5s, hw_error_rate):

        """
        Populates all Miner Results for a particular poll cycle
        :param miner: Miner Object
        :param elapsed_secs: Number of Seconds that miner has been running
        :param worker: (String) worker ID
        :param algo: (String) Algorithm running on Miner at that time
        :param pool: The Pool ID being mined
        :param chips: MinerChipStats object
        :param temps: (list) of temps on miner
        :param fan_speeds: (list) of fan speeds on miner
        :param hashrate_ghs5s: "current" Hashrate in GigaHash/sec (over the last 5 or more seconds)
        :param hw_error_rate: rate of hardware errors
        :return:
        """

        self.set_result(miner, 'uptimes', timedelta(seconds=elapsed_secs))
        self.set_result(miner, 'temperatures', temps) # all temps
        self.set_result(miner, 'temperature', math_functions.get_average_of_list(temps, 0))
        self.set_result(miner, 'hw_error_rates', hw_error_rate)

        self.populate_chip_results(miner, chips)
        self.populate_fan_results(miner, fan_speeds)

        call_pool_apis = True
        call_hashrate_calcs = True

        try:
            if sys._unit_tests_running:
                call_pool_apis = sys._unit_tests_MINERMEDIC_CALL_POOL_APIS
                call_hashrate_calcs = sys._unit_tests_MINERMEDIC_CALL_HASHRATE_CALCS
        except:
            pass

        if call_pool_apis:
            try:
                self.__process_miner_pool_apis(miner, worker, algo, pool)
            except Exception as ex:
                logger.error("Problem while processing POOL APIS, pool='{}', error='{}'".format(pool, ex))

        if call_hashrate_calcs:
            try:
                self.__process_hashrate_calculations(miner, hashrate_ghs5s, algo)
            except Exception as ex:
                logger.error("Problem while processing Hashrate Calcs, "
                             "algo='{}', hashrate='{}', error='{}'".format(algo, hashrate_ghs5s, ex))

        Populates all Miner Results for a particular poll cycle
        :param miner: Miner Object
        :param elapsed_secs: Number of Seconds that miner has been running
        :param worker: (String) worker ID
        :param algo: (String) Algorithm running on Miner at that time
        :param pool: The Pool ID being mined
        :param chips: MinerChipStats object
        :param temps: (list) of temps on miner
        :param fan_speeds: (list) of fan speeds on miner
        :param hashrate_ghs5s: "current" Hashrate in GigaHash/sec (over the last 5 or more seconds)
        :param hw_error_rate: rate of hardware errors
        :return:
        
Populates all Miner Results for a particular poll cycle
Populates all Miner Results for a particular poll cycle
def populate_miner_results(self, miner, elapsed_secs, worker, algo, pool, chips,
                               temps, fan_speeds, hashrate_ghs5s, hw_error_rate):
        self.set_result(miner, 'uptimes', timedelta(seconds=elapsed_secs))
        self.set_result(miner, 'temperatures', temps) 
        self.set_result(miner, 'temperature', math_functions.get_average_of_list(temps, 0))
        self.set_result(miner, 'hw_error_rates', hw_error_rate)
        self.populate_chip_results(miner, chips)
        self.populate_fan_results(miner, fan_speeds)
        call_pool_apis = True
        call_hashrate_calcs = True
        try:
            if sys._unit_tests_running:
                call_pool_apis = sys._unit_tests_MINERMEDIC_CALL_POOL_APIS
                call_hashrate_calcs = sys._unit_tests_MINERMEDIC_CALL_HASHRATE_CALCS
        except:
            pass
        if call_pool_apis:
            try:
                self.__process_miner_pool_apis(miner, worker, algo, pool)
            except Exception as ex:
                logger.error("Problem while processing POOL APIS, pool='{}', error='{}'".format(pool, ex))
        if call_hashrate_calcs:
            try:
                self.__process_hashrate_calculations(miner, hashrate_ghs5s, algo)
            except Exception as ex:
                logger.error("Problem while processing Hashrate Calcs, "
                             "algo='{}', hashrate='{}', error='{}'".format(algo, hashrate_ghs5s, ex))
def populate_miner_results ( self , miner , elapsed_secs , worker , algo , pool , chips , temps , fan_speeds , hashrate_ghs5s , hw_error_rate ) : self . set_result ( miner , 'uptimes' , timedelta ( seconds = elapsed_secs ) ) self . set_result ( miner , 'temperatures' , temps ) self . set_result ( miner , 'temperature' , math_functions . get_average_of_list ( temps , 0 ) ) self . set_result ( miner , 'hw_error_rates' , hw_error_rate ) self . populate_chip_results ( miner , chips ) self . populate_fan_results ( miner , fan_speeds ) call_pool_apis = True call_hashrate_calcs = True try : if sys . _unit_tests_running : call_pool_apis = sys . _unit_tests_MINERMEDIC_CALL_POOL_APIS call_hashrate_calcs = sys . _unit_tests_MINERMEDIC_CALL_HASHRATE_CALCS except : pass if call_pool_apis : try : self . __process_miner_pool_apis ( miner , worker , algo , pool ) except Exception as ex : logger . error ( "Problem while processing POOL APIS, pool='{}', error='{}'" . format ( pool , ex ) ) if call_hashrate_calcs : try : self . __process_hashrate_calculations ( miner , hashrate_ghs5s , algo ) except Exception as ex : logger . error ( "Problem while processing Hashrate Calcs, " "algo='{}', hashrate='{}', error='{}'" . format ( algo , hashrate_ghs5s , ex ) )
Populates all Miner Results for a particular poll cycle
Populates all Miner Results for a particular poll cycle
"""
        Populates all Miner Results for a particular poll cycle
        :param miner: Miner Object
        :param elapsed_secs: Number of Seconds that miner has been running
        :param worker: (String) worker ID
        :param algo: (String) Algorithm running on Miner at that time
        :param pool: The Pool ID being mined
        :param chips: MinerChipStats object
        :param temps: (list) of temps on miner
        :param fan_speeds: (list) of fan speeds on miner
        :param hashrate_ghs5s: "current" Hashrate in GigaHash/sec (over the last 5 or more seconds)
        :param hw_error_rate: rate of hardware errors
        :return:
        """ # all temps
None
self
miner
None
elapsed_secs
Number of Seconds that miner has been running
Number of Seconds that miner has been running
worker
(String) worker ID
( String ) worker ID
algo
(String) Algorithm running on Miner at that time
( String ) Algorithm running on Miner at that time
pool
The Pool ID being mined
The Pool ID being mined
chips
None
temps
(list) of temps on miner
( list ) of temps on miner
fan_speeds
(list) of fan speeds on miner
( list ) of fan speeds on miner
hashrate_ghs5s
"current" Hashrate in GigaHash/sec (over the last 5 or more seconds)
" current " Hashrate in GigaHash / sec ( over the last 5 or more seconds )
hw_error_rate
rate of hardware errors
rate of hardware errors