Exemplo n.º 1
0
 def runInstanceJmap(self, topology_info, instance_id):
     """
 Fetches Instance jstack from heron-shell.
 """
     pid_response = yield getInstancePid(topology_info, instance_id)
     try:
         http_client = tornado.httpclient.AsyncHTTPClient()
         pid_json = json.loads(pid_response)
         pid = pid_json['stdout'].strip()
         if pid == '':
             raise Exception('Failed to get pid')
         endpoint = utils.make_shell_endpoint(topology_info, instance_id)
         url = "%s/jmap/%s" % (endpoint, pid)
         response = yield http_client.fetch(url)
         LOG.debug("HTTP call for url: %s" % url)
         raise tornado.gen.Return(response.body)
     except tornado.httpclient.HTTPError as e:
         raise Exception(str(e))
Exemplo n.º 2
0
 def getInstanceJstack(self, topology_info, instance_id):
   """
   Fetches Instance jstack from heron-shell.
   """
   pid_response = yield getInstancePid(topology_info, instance_id)
   try:
     http_client = tornado.httpclient.AsyncHTTPClient()
     pid_json = json.loads(pid_response)
     pid = pid_json['stdout'].strip()
     if pid == '':
       raise Exception('Failed to get pid')
     endpoint = utils.make_shell_endpoint(topology_info, instance_id)
     url = "%s/jstack/%s" % (endpoint, pid)
     response = yield http_client.fetch(url)
     LOG.debug("HTTP call for url: %s" % url)
     raise tornado.gen.Return(response.body)
   except tornado.httpclient.HTTPError as e:
     raise Exception(str(e))
Exemplo n.º 3
0
 def getInstanceMemoryHistogram(self, topology_info, instance_id):
     """
 Fetches Instance top memory item as histogram.
 """
     pid_response = yield getInstancePid(topology_info, instance_id)
     try:
         http_client = tornado.httpclient.AsyncHTTPClient()
         pid_json = json.loads(pid_response)
         pid = pid_json['stdout'].strip()
         if pid == '':
             raise Exception('Failed to get pid')
         endpoint = utils.make_shell_endpoint(topology_info, instance_id)
         url = "%s/histo/%s" % (endpoint, pid)
         response = yield http_client.fetch(url)
         Log.debug("HTTP call for url: %s", url)
         raise tornado.gen.Return(response.body)
     except tornado.httpclient.HTTPError as e:
         raise Exception(str(e))
Exemplo n.º 4
0
 def getInstanceMemoryHistogram(self, topology_info, instance_id):
   """
   Fetches Instance top memory item as histogram.
   """
   pid_response = yield getInstancePid(topology_info, instance_id)
   try:
     http_client = tornado.httpclient.AsyncHTTPClient()
     component_id = instance_id.split('_')[1] # Format: container_<id>_<instance_id>
     pid_json = json.loads(pid_response)
     pid = pid_json['stdout'].strip()
     if pid == '':
       raise Exception('Failed to get pid')
     endpoint = utils.make_shell_endpoint(topology_info, instance_id)
     url = "%s/histo/%s" % (endpoint, pid)
     response = yield http_client.fetch(url)
     LOG.debug("HTTP call for url: %s" % url)
     raise tornado.gen.Return(response.body)
   except tornado.httpclient.HTTPError as e:
     raise Exception(str(e))