def collect_state(self, configurations):
num_ex_gw_ports = <NUM_LIT:0><EOL>num_interfaces = <NUM_LIT:0><EOL>num_floating_ips = <NUM_LIT:0><EOL>router_infos = self.router_info.values()<EOL>num_routers = len(router_infos)<EOL>num_hd_routers = collections.defaultdict(int)<EOL>for ri in router_infos:<EOL><INDENT>ex_gw_port = ri.router.get('<STR_LIT>')<EOL>if ex_gw_port:<EOL><INDENT>num_ex_gw_ports += <NUM_LIT:1><EOL><DEDENT>num_interfaces += len(ri.router.get(<EOL>bc.constants.INTERFACE_KEY, []))<EOL>num_floating_ips += len(ri.router.get(<EOL>bc.constants.FLOATINGIP_KEY, []))<EOL>hd = ri.router['<STR_LIT>']<EOL>if hd:<EOL><INDENT>num_hd_routers[hd['<STR_LIT:id>']] += <NUM_LIT:1><EOL><DEDENT><DEDENT>routers_per_hd = dict((hd_id, {'<STR_LIT>': num})<EOL>for hd_id, num in num_hd_routers.items())<EOL>non_responding = self._dev_status.get_backlogged_hosting_devices()<EOL>configurations['<STR_LIT>'] = num_routers<EOL>configurations['<STR_LIT>'] = num_ex_gw_ports<EOL>configurations['<STR_LIT>'] = num_interfaces<EOL>configurations['<STR_LIT>'] = num_floating_ips<EOL>configurations['<STR_LIT>'] = routers_per_hd<EOL>configurations['<STR_LIT>'] = non_responding<EOL>return configurations<EOL>
Collect state from this helper.

        A set of attributes which summarizes the state of the routers and
        configurations managed by this config agent.
        :param configurations: dict of configuration values
        :return dict of updated configuration values