minermedic/miner_results.py
def populate_pool_results(self, miner, worker, pool, algo, algo_idx, coin_idx, coin_cost,
                              profitability, speed_accepted, speed_reported, speed_suffix):

        """
        Populates all the pool results for a particular Miner.
        :param miner: Miner Object
        :param worker: (String) worker ID
        :param pool: (Integer) Pool ID
        :param algo: (String) Algo currently running on the miner
        :param algo_idx: (Integer) Algo index (internal)
        :param coin_idx: (Integer) Coin index (internal)
        :param coin_cost: (Float) Current cost of COIN being mined
        :param profitability: (Float) Current profitability in terms of COIN / SPEED / DAY
        :param speed_accepted: (Integer) Current Accepted Hashrate by the Pool (SPEED)
        :param speed_reported: (Integer) Current Hashrate reported by Miner
        :param speed_suffix: (String) The units of Hashrate (i.e. GH/s)
        :return: None
        """

        # Determine how much COIN is being generated per minute for the
        # accepted hashrate (stats are usually collected once each minute)
        # multiply the number of units of speed (speed accepted) by the profitability,
        # divided by 1440 minutes per day

        coin_generated_per_minute = (profitability * speed_accepted) / (60 * 24)

        # compute amount of power used and the cost of that power, per minute
        power_used, power_used_cost = get_power_usage_info_per_algo_per_minute(self, miner, algo)

        # must always set worker, algo, pool
        self.set_result(miner, 'worker', worker)
        self.set_result(miner, 'algo', algo_idx)
        self.set_result(miner, 'pool', pool)

        # set the algo stats - for hashrate calculations later

        self.set_result(miner, 'hashrates_by_algo',
                        {algo: {'accepted': speed_accepted,
                                'reported': speed_reported,
                                'speed_suffix': speed_suffix}})

        # derived stats
        self.set_result(miner, 'power_used', power_used)
        self.set_result(miner, 'power_used_cost', power_used_cost)
        self.set_result(miner, 'coin', coin_idx)
        self.set_result(miner, 'coin_cost', coin_cost)
        self.set_result(miner, 'coin_mined', coin_generated_per_minute)

        # save the current coin index in the miner
        miner.coin_idx = coin_idx

        # how much would it cost to purchase this much generated coin, instead?
        coin_purchase_cost = (coin_cost * coin_generated_per_minute)
        self.set_result(miner, 'coin_purchase_cost', coin_purchase_cost)

        # did we get power used cost so we can determine Profitability?
        if power_used_cost is not None and power_used_cost != 0:

            # PROFITABILITY - (cost to buy) / (cost to mine) >1 is profitable
            self.set_result(miner, 'profitability', (coin_purchase_cost / power_used_cost))

            # BOOLEAN is it profitable
            self.set_result(miner, 'profitable', (coin_purchase_cost > power_used_cost))

        Populates all the pool results for a particular Miner.
        :param miner: Miner Object
        :param worker: (String) worker ID
        :param pool: (Integer) Pool ID
        :param algo: (String) Algo currently running on the miner
        :param algo_idx: (Integer) Algo index (internal)
        :param coin_idx: (Integer) Coin index (internal)
        :param coin_cost: (Float) Current cost of COIN being mined
        :param profitability: (Float) Current profitability in terms of COIN / SPEED / DAY
        :param speed_accepted: (Integer) Current Accepted Hashrate by the Pool (SPEED)
        :param speed_reported: (Integer) Current Hashrate reported by Miner
        :param speed_suffix: (String) The units of Hashrate (i.e. GH/s)
        :return: None
        
Populates all the pool results for a particular Miner.
Populates all the pool results for a particular Miner .
def populate_pool_results(self, miner, worker, pool, algo, algo_idx, coin_idx, coin_cost,
                              profitability, speed_accepted, speed_reported, speed_suffix):
        coin_generated_per_minute = (profitability * speed_accepted) / (60 * 24)
        power_used, power_used_cost = get_power_usage_info_per_algo_per_minute(self, miner, algo)
        self.set_result(miner, 'worker', worker)
        self.set_result(miner, 'algo', algo_idx)
        self.set_result(miner, 'pool', pool)
        self.set_result(miner, 'hashrates_by_algo',
                        {algo: {'accepted': speed_accepted,
                                'reported': speed_reported,
                                'speed_suffix': speed_suffix}})
        self.set_result(miner, 'power_used', power_used)
        self.set_result(miner, 'power_used_cost', power_used_cost)
        self.set_result(miner, 'coin', coin_idx)
        self.set_result(miner, 'coin_cost', coin_cost)
        self.set_result(miner, 'coin_mined', coin_generated_per_minute)
        miner.coin_idx = coin_idx
        coin_purchase_cost = (coin_cost * coin_generated_per_minute)
        self.set_result(miner, 'coin_purchase_cost', coin_purchase_cost)
        if power_used_cost is not None and power_used_cost != 0:
            self.set_result(miner, 'profitability', (coin_purchase_cost / power_used_cost))
            self.set_result(miner, 'profitable', (coin_purchase_cost > power_used_cost))
def populate_pool_results ( self , miner , worker , pool , algo , algo_idx , coin_idx , coin_cost , profitability , speed_accepted , speed_reported , speed_suffix ) : coin_generated_per_minute = ( profitability * speed_accepted ) / ( 60 * 24 ) power_used , power_used_cost = get_power_usage_info_per_algo_per_minute ( self , miner , algo ) self . set_result ( miner , 'worker' , worker ) self . set_result ( miner , 'algo' , algo_idx ) self . set_result ( miner , 'pool' , pool ) self . set_result ( miner , 'hashrates_by_algo' , { algo : { 'accepted' : speed_accepted , 'reported' : speed_reported , 'speed_suffix' : speed_suffix } } ) self . set_result ( miner , 'power_used' , power_used ) self . set_result ( miner , 'power_used_cost' , power_used_cost ) self . set_result ( miner , 'coin' , coin_idx ) self . set_result ( miner , 'coin_cost' , coin_cost ) self . set_result ( miner , 'coin_mined' , coin_generated_per_minute ) miner . coin_idx = coin_idx coin_purchase_cost = ( coin_cost * coin_generated_per_minute ) self . set_result ( miner , 'coin_purchase_cost' , coin_purchase_cost ) if power_used_cost is not None and power_used_cost != 0 : self . set_result ( miner , 'profitability' , ( coin_purchase_cost / power_used_cost ) ) self . set_result ( miner , 'profitable' , ( coin_purchase_cost > power_used_cost ) )
Populates all the pool results for a particular Miner.
Populates all the pool results for a particular Miner .
"""
        Populates all the pool results for a particular Miner.
        :param miner: Miner Object
        :param worker: (String) worker ID
        :param pool: (Integer) Pool ID
        :param algo: (String) Algo currently running on the miner
        :param algo_idx: (Integer) Algo index (internal)
        :param coin_idx: (Integer) Coin index (internal)
        :param coin_cost: (Float) Current cost of COIN being mined
        :param profitability: (Float) Current profitability in terms of COIN / SPEED / DAY
        :param speed_accepted: (Integer) Current Accepted Hashrate by the Pool (SPEED)
        :param speed_reported: (Integer) Current Hashrate reported by Miner
        :param speed_suffix: (String) The units of Hashrate (i.e. GH/s)
        :return: None
        """ # Determine how much COIN is being generated per minute for the # accepted hashrate (stats are usually collected once each minute) # multiply the number of units of speed (speed accepted) by the profitability, # divided by 1440 minutes per day # compute amount of power used and the cost of that power, per minute # must always set worker, algo, pool # set the algo stats - for hashrate calculations later # derived stats # save the current coin index in the miner # how much would it cost to purchase this much generated coin, instead? # did we get power used cost so we can determine Profitability? # PROFITABILITY - (cost to buy) / (cost to mine) >1 is profitable # BOOLEAN is it profitable
None
self
miner
None
worker
(String) worker ID
( String ) worker ID
pool
(Integer) Pool ID
( Integer ) Pool ID
algo
(String) Algo currently running on the miner
( String ) Algo currently running on the miner
algo_idx
(Integer) Algo index (internal)
( Integer ) Algo index ( internal )
coin_idx
(Integer) Coin index (internal)
( Integer ) Coin index ( internal )
coin_cost
(Float) Current cost of COIN being mined
( Float ) Current cost of COIN being mined
profitability
(Float) Current profitability in terms of COIN / SPEED / DAY
( Float ) Current profitability in terms of COIN / SPEED / DAY
speed_accepted
(Integer) Current Accepted Hashrate by the Pool (SPEED)
( Integer ) Current Accepted Hashrate by the Pool ( SPEED )
speed_reported
(Integer) Current Hashrate reported by Miner
( Integer ) Current Hashrate reported by Miner
speed_suffix
(String) The units of Hashrate
( String ) The units of Hashrate