def _parse_heap_status(self, status):
        # parse heap statistics
        # TODO -- break this into more granular searches / should be more robust
        result = {}
        start = status.find("<h1>JVM</h1>")
        if start > -1:
            m = re.match(r"[\w\W]*CMS Old Gen<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><\/tr>"
                          "[\w\W]*Eden Space<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><\/tr>"
                          "[\w\W]*Survivor Space<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><\/tr>"
                          "[\w\W]*CMS Perm Gen<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><\/tr>"
                          "[\w\W]*Code Cache<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><td>([\w\W]*)<\/td><\/tr><\/tbody><\/table>[\w\W]+",
                          status[start + 12:])
            if m != None:
                # result["cms_old_gen.type"] = m.group(1)
                result["cms_old_gen.initial"] = [ 'initial', _convert_to_megabytes(m.group(2)), 'pool', 'cms_old_gen' ]
                result["cms_old_gen.total"] = [ 'allocated', _convert_to_megabytes(m.group(3)), 'pool', 'cms_old_gen' ]
                result["cms_old_gen.maximum"] = [ 'max', _convert_to_megabytes(m.group(4)), 'pool', 'cms_old_gen' ]
                result["cms_old_gen.used"] = [ 'used', _convert_to_megabytes(m.group(5)), 'pool', 'cms_old_gen' ]
                # result["eden_space.type"] = m.group(6)
                result["eden_space.initial"] = [ 'initial', _convert_to_megabytes(m.group(7)), 'pool', 'eden_space' ]
                result["eden_space.total"] = [ 'allocated', _convert_to_megabytes(m.group(8)), 'pool', 'eden_space' ]
                result["eden_space.maximum"] = [ 'max', _convert_to_megabytes(m.group(9)), 'pool', 'eden_space' ]
                result["eden_space.used"] = [ 'used', _convert_to_megabytes(m.group(10)), 'pool', 'eden_space' ]
                # result["survivor_space.type"] = m.group(11)
                result["survivor_space.initial"] = [ 'initial', _convert_to_megabytes(m.group(12)), 'pool', 'survivor_space' ]
                result["survivor_space.total"] = [ 'allocated', _convert_to_megabytes(m.group(13)), 'pool', 'survivor_space' ]
                result["survivor_space.maximum"] = [ 'max', _convert_to_megabytes(m.group(14)), 'pool', 'survivor_space' ]
                result["survivor_space.used"] = [ 'used', _convert_to_megabytes(m.group(15)), 'pool', 'survivor_space' ]
                # result["cms_perm_gen.type"] = m.group(16)
                result["cms_perm_gen.initial"] = [ 'initial', _convert_to_megabytes(m.group(17)), 'pool', 'cms_perm_gen' ]
                result["cms_perm_gen.total"] = [ 'allocated', _convert_to_megabytes(m.group(18)), 'pool', 'cms_perm_gen' ]
                result["cms_perm_gen.maximum"] = [ 'max', _convert_to_megabytes(m.group(19)), 'pool', 'cms_perm_gen' ]
                result["cms_perm_gen.used"] = [ 'used', _convert_to_megabytes(m.group(20)), 'pool', 'cms_perm_gen' ]
                # result["code_cache.type"] = m.group(21)
                result["code_cache.initial"] = [ 'initial', _convert_to_megabytes(m.group(22)), 'pool', 'code_cache' ]
                result["code_cache.total"] = [ 'allocated', _convert_to_megabytes(m.group(23)), 'pool', 'code_cache' ]
                result["code_cache.maximum"] = [ 'max', _convert_to_megabytes(m.group(24)), 'pool', 'code_cache' ]
                result["code_cache.used"] = [ 'used', _convert_to_megabytes(m.group(25)), 'pool', 'code_cache' ]
        return result
dataset/ETHPy150Open scalyr/scalyr-agent-2/scalyr_agent/builtin_monitors/tomcat_monitor.py/TomcatMonitor._parse_heap_status/original