jtop/service.py
def _total_power(self, power):
        """
        Private function to measure the total watt

        :return: Total power and a second dictionary with all other measures
        :rtype: dict, dict
        """
        # In according with:
        # https://forums.developer.nvidia.com/t/power-consumption-monitoring/73608/8
        # https://github.com/rbonghi/jetson_stats/issues/51
        total_name = ""
        for val in power:
            if "IN" in val:
                total_name = val
                break
        # Extract the total from list
        # Otherwise sum all values
        # Example for Jetson Xavier
        # https://forums.developer.nvidia.com/t/xavier-jetson-total-power-consumption/81016
        if total_name:
            total = power[total_name]
            del power[total_name]
            return total, power
        # Otherwise measure all total power
        total = {'cur': 0, 'avg': 0}
        for value in power.values():
            total['cur'] += value['cur']
            total['avg'] += value['avg']
        return total, power

        Private function to measure the total watt

        :return: Total power and a second dictionary with all other measures
        :rtype: dict, dict
        
Private function to measure the total watt
Private function to measure the total watt
def _total_power(self, power):
        total_name = ""
        for val in power:
            if "IN" in val:
                total_name = val
                break
        if total_name:
            total = power[total_name]
            del power[total_name]
            return total, power
        total = {'cur': 0, 'avg': 0}
        for value in power.values():
            total['cur'] += value['cur']
            total['avg'] += value['avg']
        return total, power
def _total_power ( self , power ) : total_name = "" for val in power : if "IN" in val : total_name = val break if total_name : total = power [ total_name ] del power [ total_name ] return total , power total = { 'cur' : 0 , 'avg' : 0 } for value in power . values ( ) : total [ 'cur' ] += value [ 'cur' ] total [ 'avg' ] += value [ 'avg' ] return total , power
Private function to measure the total watt
Private function to measure the total watt
"""
        Private function to measure the total watt

        :return: Total power and a second dictionary with all other measures
        :rtype: dict, dict
        """ # In according with: # https://forums.developer.nvidia.com/t/power-consumption-monitoring/73608/8 # https://github.com/rbonghi/jetson_stats/issues/51 # Extract the total from list # Otherwise sum all values # Example for Jetson Xavier # https://forums.developer.nvidia.com/t/xavier-jetson-total-power-consumption/81016 # Otherwise measure all total power
Total power and a second dictionary with all other measures
Total power and a second dictionary with all other measures
dict, dict
self
power