def collect(self):
        for host in self.config['hosts']:
            matches = re.search(
                '^([^:]*):([^@]*)@([^:]*):?([^/]*)/([^/]*)/?(.*)$', host)

            if not matches:
                continue

            params = {}

            params['host'] = matches.group(3)
            try:
                params['port'] = int(matches.group(4))
            except __HOLE__:
                params['port'] = 3306
            params['db'] = matches.group(5)
            params['user'] = matches.group(1)
            params['passwd'] = matches.group(2)

            nickname = matches.group(6)
            if len(nickname):
                nickname += '.'

            self.connect(params=params)
            if self.config['slave']:
                self.slave_load(nickname, 'thread/sql/slave_io')
                self.slave_load(nickname, 'thread/sql/slave_sql')
            self.db.close()
dataset/ETHPy150Open python-diamond/Diamond/src/collectors/mysqlstat/mysql55.py/MySQLPerfCollector.collect