def send_all_stats():
 deployment_id = helper.get_deployment_id()
 if (not deployment_id):
  return
 logging.debug('Getting all stats from every deployment node.')
 all_stats = helper.get_all_stats()
 portal_path = hermes_constants.PORTAL_STATS_PATH.format(deployment_id)
 url = '{0}{1}'.format(hermes_constants.PORTAL_URL, portal_path)
 data = {JSONTags.DEPLOYMENT_ID: deployment_id, JSONTags.TIMESTAMP: datetime.datetime.utcnow(), JSONTags.ALL_STATS: json.dumps(all_stats)}
 logging.debug('Sending all stats to the AppScale Portal. Data: \n{}'.format(data))
 request = helper.create_request(url=url, method='POST', body=urllib.urlencode(data))
 response = helper.urlfetch(request)
 if (not response[JSONTags.SUCCESS]):
  logging.error('Inaccessible resource: {}'.format(url))
  return

def send_all_stats ( ) : deployment_id = helper . get_deployment_id ( ) if ( not deployment_id ) : return logging . debug ( 'Getting all stats from every deployment node.' ) all_stats = helper . get_all_stats ( ) portal_path = hermes_constants . PORTAL_STATS_PATH . format ( deployment_id ) url = '{0}{1}' . format ( hermes_constants . PORTAL_URL , portal_path ) data = { JSONTags . DEPLOYMENT_ID : deployment_id , JSONTags . TIMESTAMP : datetime . datetime . utcnow ( ) , JSONTags . ALL_STATS : json . dumps ( all_stats ) } logging . debug ( 'Sending all stats to the AppScale Portal. Data: \n{}' . format ( data ) ) request = helper . create_request ( url = url , method = 'POST' , body = urllib . urlencode ( data ) ) response = helper . urlfetch ( request ) if ( not response [ JSONTags . SUCCESS ] ) : logging . error ( 'Inaccessible resource: {}' . format ( url ) ) return
calls get_all_stats and sends the deployment monitoring stats to the appscale portal .