sampro/sampro.py
def rooted_samples_by_file(self):
        '''
        Get sample counts by file, and root thread function.
        (Useful for answering quesitons like "what modules are hot?")
        '''
        rooted_leaf_samples, _ = self.live_data_copy()
        rooted_file_samples = {}
        for root, counts in rooted_leaf_samples.items():
            cur = {}
            for key, count in counts.items():
                code, lineno = key
                cur.setdefault(code.co_filename, 0)
                cur[code.co_filename] += count
            rooted_file_samples[root] = cur
        return rooted_file_samples
def rooted_samples_by_file(self):
        '''
        Get sample counts by file, and root thread function.
        (Useful for answering quesitons like "what modules are hot?")
        '''
        rooted_leaf_samples, _ = self.live_data_copy()
        rooted_file_samples = {}
        for root, counts in rooted_leaf_samples.items():
            cur = {}
            for key, count in counts.items():
                code, lineno = key
                cur.setdefault(code.co_filename, 0)
                cur[code.co_filename] += count
            rooted_file_samples[root] = cur
        return rooted_file_samples
def rooted_samples_by_file ( self ) : rooted_leaf_samples , _ = self . live_data_copy ( ) rooted_file_samples = { } for root , counts in rooted_leaf_samples . items ( ) : cur = { } for key , count in counts . items ( ) : code , lineno = key cur . setdefault ( code . co_filename , 0 ) cur [ code . co_filename ] += count rooted_file_samples [ root ] = cur return rooted_file_samples
Get sample counts by file, and root thread function.
        (Useful for answering quesitons like "what modules are hot?")
Get sample counts by file and root thread function . ( Useful for answering quesitons like what modules are hot? )