src/tools/benchmark_tool/benchmark_tool/rqt_graph/rosgraph2_impl.py
def update(self):
        """
        Update all the stats.

        This method may take awhile to complete as it will
        communicate with all nodes + master.
        """
        last_node_refresh = self.last_node_refresh

        # nodes left to check
        update_queue = None
        # True if there are still more stats to fetch this cycle
        work_to_do = True
        # return value. True if new data differs from old
        updated = False
        # number of nodes we checked
        num_nodes = 0

        while work_to_do:

            # each time through the loop try to talk to either the master
            # or a node. stop when we have talked to everybody.

            # get a new node list from the master
            if time.time() > (self.last_graph_refresh + self.graph_stale):
                updated = self._graph_refresh()
                self.last_graph_refresh = time.time()
            # contact the nodes for stats
            else:
                # initialize update_queue based on most current nodes list
                if update_queue is None:
                    update_queue = list(self.nn_nodes)
                # no nodes left to contact
                elif not update_queue:
                    work_to_do = False
                # contact next node
                else:
                    # figure out the next node to contact
                    next = update_queue.pop()
                    # rate limit talking to any particular node
                    if time.time() > (last_node_refresh.get(next, 0.0) + self.node_stale):
                        updated = self._node_refresh(next) or updated
                        # include in random offset (max 1/5th normal update interval)
                        # to help spread out updates
                        last_node_refresh[next] = \
                            time.time() + (random.random() * self.node_stale / 5.0)
                        num_nodes += 1

            # small yield to keep from torquing the processor
            time.sleep(0.01)
        return updated

        Update all the stats.

        This method may take awhile to complete as it will
        communicate with all nodes + master.
        
Update all the stats.
This method may take awhile to complete as it will
communicate with all nodes + master.
Update all the stats . This method may take awhile to complete as it will communicate with all nodes + master .
def update(self):
        last_node_refresh = self.last_node_refresh
        update_queue = None
        work_to_do = True
        updated = False
        num_nodes = 0
        while work_to_do:
            if time.time() > (self.last_graph_refresh + self.graph_stale):
                updated = self._graph_refresh()
                self.last_graph_refresh = time.time()
            else:
                if update_queue is None:
                    update_queue = list(self.nn_nodes)
                elif not update_queue:
                    work_to_do = False
                else:
                    next = update_queue.pop()
                    if time.time() > (last_node_refresh.get(next, 0.0) + self.node_stale):
                        updated = self._node_refresh(next) or updated
                        last_node_refresh[next] = \
                            time.time() + (random.random() * self.node_stale / 5.0)
                        num_nodes += 1
            time.sleep(0.01)
        return updated
def update ( self ) : last_node_refresh = self . last_node_refresh update_queue = None work_to_do = True updated = False num_nodes = 0 while work_to_do : if time . time ( ) > ( self . last_graph_refresh + self . graph_stale ) : updated = self . _graph_refresh ( ) self . last_graph_refresh = time . time ( ) else : if update_queue is None : update_queue = list ( self . nn_nodes ) elif not update_queue : work_to_do = False else : next = update_queue . pop ( ) if time . time ( ) > ( last_node_refresh . get ( next , 0.0 ) + self . node_stale ) : updated = self . _node_refresh ( next ) or updated last_node_refresh [ next ] = time . time ( ) + ( random . random ( ) * self . node_stale / 5.0 ) num_nodes += 1 time . sleep ( 0.01 ) return updated
Update all the stats.
Update all the stats .
"""
        Update all the stats.

        This method may take awhile to complete as it will
        communicate with all nodes + master.
        """ # nodes left to check # True if there are still more stats to fetch this cycle # return value. True if new data differs from old # number of nodes we checked # each time through the loop try to talk to either the master # or a node. stop when we have talked to everybody. # get a new node list from the master # contact the nodes for stats # initialize update_queue based on most current nodes list # no nodes left to contact # contact next node # figure out the next node to contact # rate limit talking to any particular node # include in random offset (max 1/5th normal update interval) # to help spread out updates # small yield to keep from torquing the processor
self