Log In | Get Help   
Home My Page Projects Code Snippets Project Openings BonFIRE VCOC Demonstration Kit
Summary Activity SCM Files Wiki
[bonfiredemokit] View of /ea/xml_conv.py
[bonfiredemokit] / ea / xml_conv.py Repository:
ViewVC logotype

View of /ea/xml_conv.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 18 - (download) (as text) (annotate)
Tue Oct 9 16:17:03 2012 UTC (11 years, 7 months ago) by agomez
File size: 35805 byte(s)
Changed comments to English and test
#
# BonFIRE Virtual Clusters on Federated Clouds Demonstration Kit
#
# Copyright (c) Fundacion Centro Tecnologico de Supercomputacion de Galicia 2012
# 
# License Apache Software
#
# The research leading to these results has received funding from 
# the European Community's Seventh Framework Programme (FP7/2007-2013) 
# under agreement number 257386
#
# This software is provided with ABSOLUTELY NO WARRANTY
# 
'''
Created on 20/01/2012

@author: R. Valin
'''
import xml.etree.ElementTree as tree
#import simplejson

#<?xml version="1.0" encoding="UTF-8"?>\
#code="""<?xml version="1.0" encoding="UTF-8"?>\
#      <managed_experiment href="/managed_experiments/13">\
#            <name>My Experiment</name>\
#            <description>Experiment description</description>\
#            <status>not_implemented</status>\
#            <link rel="experiment" href=""/>\
#            <link rel="log" href="/managed_experiments/13/log"/>\
#      </managed_experiment>"""

      
def xml_parse(code):
    """Input: XML Variable
    Ouput: list with relative URL exp, name, description,status,ruta log """
    exp_ref = dict()
    elements = tree.fromstring(code)
    for sub in elements.iter():
        if(sub.tag == 'managed_experiment'):
            #Print attributes. Returns a dictionary
            exp_ref['experiment'] = sub.attrib['href']
        if(sub.tag == 'name'):
            #Print the field for this tag
            exp_ref['name'] = sub.text
        if(sub.tag == 'description'):
            exp_ref['descrip'] = sub.text
        if(sub.tag == 'status'):
            exp_ref['status'] = sub.text
        if(sub.tag == 'link' and 'log' in sub.attrib['href']):
            exp_ref['log'] = sub.attrib['href']
    #exp=[exp_ref,exp_name,descrip,status,log]
    return exp_ref

#exp=xml_parse(code)
#print(exp)
#raiz='https://api.integration.bonfire.grid5000.fr'
#code=["# Logfile created on 2012-02-01 09:49:45 +0100 by logger.rb/25413\n", 
#       "Creating an experiment called My Experiment with user id rvalin.\n",
#       "Created broker experiment #<Restfully::Resource:0x00000009283df0>\n",
#       "Broker experiment URI is: https://api.integration.bonfire.grid5000.fr/experiments/64\n",
#       "Deploying network BonFIRE WAN to fr-inria.\n", 
#       "Resource uri is http://localhost:8000/locations/fr-inria/networks/4\n",
#       "Deploying storage BonFIRE Debian Squeeze v3 to fr-inria.\n",
#       "Resource uri is http://localhost:8000/locations/fr-inria/storages/3\n",
#       "Deploying compute JSON-COMPUTE-TEST to fr-inria.\n", 
#       "Resource uri is http://localhost:8000/locations/fr-inria/computes/21500\n",
#       "All of the resources have been deployed.\n"]

def log_parsing(code, raiz, compute):
    """Output from log plain text.
   Error:
   1.-  Info the experiment
   2.-  Infor broker experiment
   3.-  URI  broker experiment
   4.-  Info of deploying network
   5.-  Resource URI network
   6.-  Info about deploying storage
   7.-  Resource URI storage
   8.-  Info about deploying compute
   9.-  Resource URI computes
  10.-  Info about experiment status
  11.-  7 lines with info error enactor
    
   OK:
   1.-  Creation date of logfile
   2.-  Info about the experiment
   3.-  URI  broker experiment
   4.-  Info of deploying network
   5.-  Resource URI network
   6.-  Info about deploying storage
   7.-  Resource URI storage
   8.-  Info about deploying compute
   9.-  Resource URI computes
  10.-  Info about experiment status
"""

#["# Logfile created on 2012-02-22 16:17:24 +0000 by logger.rb/25413\n", 
#"Creating an experiment called My Experiment with user id rvalin.\n", 
#"Created broker experiment #<Restfully::Resource:0x0000000c059590>\n", 
#"Broker experiment URI is: https://api.bonfire-project.eu/experiments/502\n", 
#"Deploying network BonFIRE WAN to fr-inria.\n", 
#"location is {\"name\"=>\"fr-inria\", \"url\"=>\"https://frontend.bonfire.grid5000.fr:443\"}\n",
#"Resource uri is http://localhost:8000/locations/fr-inria/networks/0\n", 
#"Deploying storage BonFIRE Debian Squeeze v3 to fr-inria.\n", 
#"Resource uri is http://localhost:8000/locations/fr-inria/storages/1\n", 
#"Deploying compute JSON-COMPUTE-TEST to fr-inria.\n", 
#"Resource uri is http://localhost:8000/locations/fr-inria/computes/714\n", 
#"All of the resources have been deployed.\n"]

    log = dict()
    log['deployed'] = ''
    log['error']=0
    #compute=[]
    print 'EM reply:', code
    # Check errors in the answer. 
    if 'Error' in str(code):
            print 'Broker api error:', code
            log['error'] = 1
    else:
        for i in code:
            print (i)
            #if 'Error' in i:
            #    print 'Broker api error:', code
            #    log['error'] = 1
            if 'Logfile created' in i:
                log['Logfile'] = i.split('created on')[1].split('by')[0]
            if 'Broker experiment URI is:' in i:
                log['broker'] = i.split('Broker experiment URI is:')[1].split('\n')[0].strip()
            if 'storages' in i and 'resource uri is' in i:
                log['storages'] = i.split('resource uri is')[1].split('\n')[0].strip().replace('http://localhost:8000', raiz)
            if 'computes' in i and 'resource uri is' in i:
                #print 'compute:', compute
                if (i.split('resource uri is')[1].split('\n')[0].strip().replace('http://localhost:8000', raiz) not in compute):
                    compute.append(i.split('resource uri is')[1].split('\n')[0].strip().replace('http://localhost:8000', raiz))
                    log['computes'] = compute
            if 'networks' in i and 'resource uri is' in i:
		print i.split('resource uri is')
                log['networks'] = i.split('resource uri is')[1].split('\n')[0].strip().replace('http://localhost:8000', raiz)
            if 'All of the resources have been deployed' in i:
                log['deployed'] = i
    
    return log



def xml_compute_parse(code):
    compute_info = dict()
    #print code
    elements = tree.fromstring(code)
    for sub in elements.iter():
        #print sub
        if('cpu' in sub.tag):
            #Print attributes
            #print sub.text
            compute_info['cpu'] = sub.text
        if('memory' in sub.tag):

            compute_info['mem'] = sub.text
        if('hostname' in sub.tag):
            compute_info['hostname'] = sub.text
        if('instance' in sub.tag):
            compute_info['instance'] = sub.text
        if('state' in sub.tag):
            compute_info['state'] = sub.text
        if('ip' in sub.tag):
            compute_info['ip'] = sub.text
        if('state' in sub.tag):
            compute_info['state'] = sub.text
        if('name' in sub.tag and 'hostname' not in sub.tag):
            compute_info['name'] = sub.text
        if('disk' in sub.tag):
            for sub1 in sub.iter():
                if('storage' in sub1.tag):
                        compute_info['disk_ref'] = sub1.attrib['href']
        if('nic' in sub.tag):
           for sub1 in sub.iter():
                if('network' in sub1.tag):
                        compute_info['net_ref'] = sub1.attrib['href']
                        compute_info['loc_ref'] = sub1.attrib['href'].split('/networks')[0]

    #exp=[exp_ref,exp_name,descrip,status,log]
    return compute_info

#print(log_parsing(code,raiz))
#data=xml_compute_parse(code)
#print(data)

#print (xml_compute_parse(code))

mon=(2, {'compute-5-11.local': {'std': 0.27531010070510958, 'median': 65.746219592373436, 'rates': [66.24710168930109, 65.955809607562927, 65.67425569176882, 65.746219592373436, 66.02839220864972, 65.876152832674578, 65.71741511500548, 65.56660474265108, 65.905096660808439, 65.040650406504071, 65.595277140045908, 65.739016106058941, 65.868920847513451], 'histories': 780000, 'mean': 65.766224049301371}, 'compute-4-11.local': {'std': 0.16944217389085148, 'median': 65.366604651039125, 'rates': [65.22448092183933, 65.267051017078217, 65.437888537463195, 65.203216692023474, 65.345240688303193, 65.387968613775058, 65.588106689986887, 65.588106689986887, 65.104166666666671, 65.281253400065282, 65.631152920586302, 65.44502617801048, 65.245759025663332, 65.075921908893704, 65.530799475753597, 65.580937807410649, 65.473592317765167, 65.22448092183933], 'histories': 1080000, 'mean': 65.36861947072839}, 'compute-5-16.local': {'std': 0.27197573731279834, 'median': 65.656298956188067, 'rates': [65.238664781994132, 66.013862911211362, 65.316786414108421, 65.631152920586302, 65.281253400065282, 65.767839526471562, 65.905096660808439, 65.818341377797282, 65.402223675604972, 65.681444991789817, 65.309676717100245, 65.516488316226258, 66.013862911211362, 65.890621568196792], 'histories': 840000, 'mean': 65.627665440940888}, 'compute-5-10.local': {'std': 0.28231155887623044, 'median': 65.934065934065927, 'rates': [65.941312232113418, 65.509335080248931, 66.40106241699867, 65.919578114700059, 65.934065934065927], 'histories': 300000, 'mean': 65.941070755625404}, 'compute-5-14.local': {'std': 0.13694861707773998, 'median': 65.952189646527188, 'rates': [65.934065934065927, 65.667067965415342, 66.021126760563391, 65.970313358988449], 'histories': 240000, 'mean': 65.898143504758281}, 'compute-5-13.local': {'std': 0.16180416050605789, 'median': 65.970313358988449, 'rates': [65.919578114700059, 65.970313358988449, 66.239788032678305, 65.760631302060503, 66.093853271645742], 'histories': 300000, 'mean': 65.996832816014617}, 'compute-4-4.local': {'std': 0.4999064894794748, 'median': 65.256426634870621, 'rates': [65.416484954208457, 65.217391304347828, 65.054754418302068, 63.897763578274763, 65.2954619653934, 64.977257959714095, 65.487884741322858, 65.395095367847418, 65.941312232113418, 65.09710317890854], 'histories': 600000, 'mean': 65.178050970043287}, 'compute-4-51.local': {'std': 13.529048653730063, 'median': 62.389518560881768, 'rates': [65.082980800520659, 34.205575508807939, 34.42143307899719, 65.366597668591353, 65.181966322650737, 46.667185190946562, 65.395095367847418, 38.178164768921633, 62.389518560881768], 'histories': 525600.0, 'mean': 52.987613029796144}, 'compute-4-21.local': {'std': 0.988076603974963, 'median': 64.766839378238345, 'rates': [63.257775434897205, 63.492063492063494, 64.766839378238345, 65.203216692023474, 65.825562260010969], 'histories': 300000, 'mean': 64.509091451446693}, 'compute-4-13.local': {'std': 0.14702779113458259, 'median': 65.832804540436186, 'rates': [65.955809607562927, 65.897858319604609, 65.724613867893524, 65.868920847513451, 65.876152832674578, 65.796688233358921, 65.480737749645314, 65.645514223194752], 'histories': 480000, 'mean': 65.780786960181004}, 'compute-4-19.local': {'std': 0.19474649681107825, 'median': 65.926822024383, 'rates': [66.166740185266875, 66.042927903137041, 66.181336863004631, 66.144857237349797, 66.064743448579605, 65.876152832674578, 66.357000663570005, 65.767839526471562, 65.883386406061263, 65.963060686015822, 65.934065934065927, 66.122988759091911, 65.941312232113418, 65.832784726793946, 65.883386406061263, 65.782260717026645, 65.7102179388895, 65.919578114700059, 65.825562260010969, 66.159444260668209, 65.516488316226258, 65.659881812212745], 'histories': 1320000, 'mean': 65.942546237726887}, 'compute-4-10.local': {'std': 0.47128705444395269, 'median': 65.423624926807719, 'rates': [64.102564102564102, 65.402223675604972, 65.81112207963146, 64.329366355741399, 65.167807103290968, 65.245759025663332, 65.545116888791782, 65.602449158101905, 66.050198150594454, 65.245759025663332, 65.44502617801048, 65.631152920586302, 65.868920847513451, 64.970221981591777, 65.695828314902002, 65.22448092183933, 65.588106689986887, 64.871878040869291, 65.552277941658474, 65.941312232113418, 64.808813998703826, 65.267051017078217, 65.245759025663332, 65.847234416154521], 'histories': 1440000, 'mean': 65.352517920513293}, 'compute-4-14.local': {'std': 0.29359497406758922, 'median': 65.955810404559912, 'rates': [65.402223675604972, 65.963060686015822, 66.393714728339049, 66.152149944873202, 65.948560123103988, 65.919578114700059, 65.530799475753597, 66.144857237349797, 65.71741511500548, 65.502183406113531, 65.580937807410649, 66.13027664499063, 66.195939982347753, 66.021126760563391], 'histories': 840000, 'mean': 65.900201693012278}, 'compute-5-21.local': {'std': 0.50364664382236057, 'median': 65.473592317765167, 'rates': [65.897858319604609, 65.516488316226258, 65.366597668591353, 65.602449158101905, 65.452165375804512, 65.502183406113531, 64.899945916711729, 64.027318322484263, 64.710957722174285, 65.760631302060503, 66.101134736146307, 65.86169045005488, 65.473592317765167, 65.210303227910003, 65.466448445171849], 'histories': 900000, 'mean': 65.389984312328068}, 'compute-5-9.local': {'std': 0.18047892481052522, 'median': 66.061274896414901, 'rates': [66.181336863004631, 66.166740185266875, 65.739016106058941, 65.955809607562927], 'histories': 240000, 'mean': 66.010725690473336}, 'compute-4-7.local': {'std': 0.41586918049818788, 'median': 65.623974625396485, 'rates': [65.203216692023474, 66.101134736146307, 65.623974625396485, 66.064743448579605, 66.195939982347753, 65.338124795818359, 65.231572080887148, 64.991334488734836, 65.63833278634722], 'histories': 540000, 'mean': 65.598708181809016}, 'compute-5-22.local': {'std': 0.47582183670229977, 'median': 65.391533544242492, 'rates': [65.380843412880026, 65.775049331286993, 64.45375443119562, 66.03565925599824, 64.488392089423911, 65.63833278634722, 65.189048239895698, 65.480737749645314, 64.822817631806387, 65.167807103290968, 65.416484954208457, 65.402223675604972, 65.409353537555873, 65.437888537463195, 65.796688233358921, 64.267352185089976, 64.495324089003546, 64.794816414686821, 65.609622744669224, 65.63833278634722, 65.061808718282364, 65.281253400065282], 'histories': 1320000, 'mean': 65.22925415036849}, 'compute-4-5.local': {'std': 0.20054348556932716, 'median': 65.005417118093177, 'rates': [65.423617926071316, 65.005417118093177, 64.991334488734836], 'histories': 180000, 'mean': 65.1401231776331}, 'compute-4-6.local': {'std': 0.53422239710398001, 'median': 64.822817631806387, 'rates': [65.153654034097087, 64.822817631806387, 64.977257959714095, 64.970221981591777, 64.047822374039285, 64.164260506897662, 65.2954619653934, 65.09710317890854, 64.857853205058916, 64.027318322484263, 64.613396510876584, 65.22448092183933, 65.352358130922553, 64.935064935064929, 65.416484954208457, 65.075921908893704, 64.530006453000652, 64.822817631806387, 63.986349578756531, 64.0, 63.959066197633511, 63.478628861616585, 64.745872450631268], 'histories': 1380000, 'mean': 64.676270421532251}, 'compute-4-53.local': {'std': 0.18842175802978689, 'median': 65.955810404559912, 'rates': [66.013862911211362, 66.291017567119653, 65.71741511500548, 65.81112207963146, 65.963060686015822, 66.115702479338836, 65.659881812212745, 65.948560123103988, 65.530799475753597, 66.101134736146307, 66.050198150594454, 65.941312232113418, 66.013862911211362, 65.695828314902002, 65.631152920586302, 65.905096660808439, 66.152149944873202, 66.006600660066013, 65.926821228436438, 66.101134736146307, 65.847234416154521, 66.101134736146307], 'histories': 1320000, 'mean': 65.932958358980827}, 'compute-6-6.local': {'std': 0.52897981502333113, 'median': 64.66911047317916, 'rates': [64.899945916711729, 64.836827317916573, 65.309676717100245, 65.054754418302068, 64.488392089423911, 64.467605028473187, 64.7878198898607, 64.391500321957508, 64.01365624666596, 64.047822374039285, 63.271116735210377, 65.259952142701763, 64.006827394922126, 65.480737749645314, 64.815815058874364, 64.676080629513848, 64.405324173465004, 64.662140316844486], 'histories': 1080000, 'mean': 64.604221917868244}, 'compute-5-8.local': {'std': 0.36226465552055642, 'median': 65.160749013185821, 'rates': [65.44502617801048, 65.402223675604972, 65.061808718282364, 65.409353537555873, 65.033600693691739, 65.588106689986887, 65.061808718282364, 65.912336592332196, 65.125366330185614, 65.616797900262469, 64.991334488734836, 65.516488316226258, 64.843834432076093, 64.752859917979706, 65.452165375804512, 65.782260717026645, 64.571674558760222, 65.423617926071316, 65.196131696186029, 65.111231687466088, 64.495324089003546, 65.040650406504071], 'histories': 1320000, 'mean': 65.219727393001548}, 'compute-6-1.local': {'std': 0.12211793319188853, 'median': 64.871878040869291, 'rates': [64.942093300140712, 64.65517241379311, 64.871878040869291], 'histories': 180000, 'mean': 64.823047918267704}, 'compute-4-17.local': {'std': 0.41555135853915642, 'median': 65.387981039195722, 'rates': [64.808813998703826, 64.564726137953301, 65.416484954208457, 65.55944055944056, 65.80390436499232, 65.912336592332196, 65.7102179388895, 65.359477124183002, 66.02839220864972, 65.153654034097087, 65.338124795818359, 65.267051017078217], 'histories': 720000, 'mean': 65.410218643862208}, 'compute-6-2.local': {'std': 0.21700550679603481, 'median': 64.292187053143749, 'rates': [64.509192559939791, 64.075181546347721], 'histories': 120000, 'mean': 64.292187053143749}, 'compute-5-15.local': {'std': 0.16698645963038358, 'median': 65.876152832674578, 'rates': [65.753424657534254, 65.760631302060503, 66.217856748703227, 66.02839220864972, 65.883386406061263, 65.999340006599937, 66.101134736146307, 65.545116888791782, 65.775049331286993, 65.847234416154521, 65.955809607562927, 65.876152832674578, 65.703022339027598, 66.03565925599824, 65.818341377797282], 'histories': 900000, 'mean': 65.886703474336613}, 'compute-4-8.local': {'std': 0.21079481164405181, 'median': 65.047701647875115, 'rates': [65.047701647875115, 64.683053040103488, 65.181966322650737], 'histories': 180000, 'mean': 64.970907003543118}, 'compute-5-6.local': {'std': 0.20221498168441351, 'median': 65.919642565186621, 'rates': [65.984823490597165, 65.85446163977609, 65.999340006599937, 66.305669134711025, 65.78947368421052, 66.2763724732133, 65.840008778667837, 65.731814198071874], 'histories': 480000, 'mean': 65.972745425730963}, 'compute-5-17.local': {'std': 0.3690895992706984, 'median': 65.595296740013424, 'rates': [65.631152920586302, 65.55944055944056, 65.181966322650737, 65.86169045005488, 66.115702479338836, 65.040650406504071], 'histories': 360000, 'mean': 65.565100523095893}, 'compute-4-16.local': {'std': 0.28050622424435356, 'median': 65.380844189214827, 'rates': [65.181966322650737, 65.80390436499232, 65.63833278634722, 65.146579804560261, 65.530799475753597, 65.196131696186029, 65.373719764654609, 65.688635865995181, 65.487884741322858, 64.998375040623984, 64.963187527067987, 65.090041223692779, 65.387968613775058, 65.659881812212745, 65.832784726793946, 65.118298241805945], 'histories': 960000, 'mean': 65.381155750527199}, 'compute-4-24.local': {'std': 0.3410502970467485, 'median': 65.252854812398041, 'rates': [64.516129032258064, 65.281253400065282, 65.160729800173769, 65.2954619653934, 65.595277140045908, 65.573770491803273, 65.160729800173769, 64.398411505849523, 65.395095367847418, 65.573770491803273, 65.090041223692779, 65.252854812398041, 64.857853205058916, 65.331010452961678, 65.167807103290968], 'histories': 900000, 'mean': 65.176679719521076}, 'compute-6-4.local': {'std': 2.2464996287703856, 'median': 63.687506634115273, 'rates': [63.761955366631241, 57.498802108289411, 63.626723223753977, 63.728093467870423, 62.978902067807283, 64.2811227769445, 64.523066996451234, 63.599745601017595, 64.377682403433482, 64.095716269629307, 63.498782939993653, 57.915057915057915, 63.687506634115273], 'histories': 780000, 'mean': 62.890242905461179}, 'compute-5-5.local': {'std': 0.18125141922743435, 'median': 65.785867200618583, 'rates': [65.825562260010969, 65.595277140045908, 65.876152832674578, 65.78947368421052, 65.919578114700059, 65.80390436499232, 65.281253400065282, 65.602449158101905, 65.588106689986887, 65.782260717026645], 'histories': 600000, 'mean': 65.706401836181527}, 'compute-5-18.local': {'std': 0.24749922890406173, 'median': 64.14029458390425, 'rates': [64.343163538873995, 64.267352185089976, 64.191719268214399, 64.088869899594101, 63.606487861761906, 64.034151547492002, 64.253587491968304, 63.843370929985106, 64.46067898581866, 63.877355477483235], 'histories': 600000, 'mean': 64.096673718628168}, 'compute-4-9.local': {'std': 2.2133047544010083, 'median': 62.08159451692346, 'rates': [59.868289762522451, 64.294899271324468], 'histories': 120000, 'mean': 62.08159451692346}, 'compute-4-3.local': {'std': 0.19628699359767415, 'median': 66.108417805200531, 'rates': [65.890621568196792, 66.108417805200531, 66.166740185266875, 66.423115244104949, 66.072018500165171, 66.386368665633995, 65.941312232113418, 66.298342541436469, 66.02839220864972, 66.174037719201493, 65.760631302060503], 'histories': 660000, 'mean': 66.113636179275446}, 'compute-4-12.local': {'std': 0.39311214972530534, 'median': 64.942105473106835, 'rates': [64.669109721922837, 65.373719764654609, 65.217391304347828, 64.061499039077518, 64.398411505849523, 65.316786414108421, 64.745872450631268, 64.599483204134373, 65.026552508941151, 64.412238325281805, 65.588106689986887, 64.780824875836743, 64.970221981591777, 65.580937807410649, 64.815815058874364, 65.01246072163832, 64.578624475298668, 65.2954619653934, 65.005417118093177, 64.913988964621879, 64.426071083431765, 65.132435953104647], 'histories': 1320000, 'mean': 64.905519587919628}, 'compute-4-23.local': {'std': 0.25822084068916706, 'median': 64.878892733564015, 'rates': [64.45375443119562, 64.913988964621879, 64.3707756678468, 64.86486486486487, 64.899945916711729, 65.160729800173769, 64.86486486486487, 64.71793765505339, 64.878892733564015, 65.118298241805945, 64.850843060959789, 65.068864548313627, 65.061808718282364, 64.906966681090438, 64.274236743438678], 'histories': 900000, 'mean': 64.827118192852524}, 'cluster': {'std': 2.5784737273574958, 'median': 65.402223675604972, 'rates': [66.24710168930109, 65.955809607562927, 65.67425569176882, 65.746219592373436, 66.02839220864972, 65.876152832674578, 65.71741511500548, 65.56660474265108, 65.905096660808439, 65.040650406504071, 65.595277140045908, 65.739016106058941, 65.868920847513451, 65.22448092183933, 65.267051017078217, 65.437888537463195, 65.203216692023474, 65.345240688303193, 65.387968613775058, 65.588106689986887, 65.588106689986887, 65.104166666666671, 65.281253400065282, 65.631152920586302, 65.44502617801048, 65.245759025663332, 65.075921908893704, 65.530799475753597, 65.580937807410649, 65.473592317765167, 65.22448092183933, 65.238664781994132, 66.013862911211362, 65.316786414108421, 65.631152920586302, 65.281253400065282, 65.767839526471562, 65.905096660808439, 65.818341377797282, 65.402223675604972, 65.681444991789817, 65.309676717100245, 65.516488316226258, 66.013862911211362, 65.890621568196792, 65.941312232113418, 65.509335080248931, 66.40106241699867, 65.919578114700059, 65.934065934065927, 65.934065934065927, 65.667067965415342, 66.021126760563391, 65.970313358988449, 65.919578114700059, 65.970313358988449, 66.239788032678305, 65.760631302060503, 66.093853271645742, 65.416484954208457, 65.217391304347828, 65.054754418302068, 63.897763578274763, 65.2954619653934, 64.977257959714095, 65.487884741322858, 65.395095367847418, 65.941312232113418, 65.09710317890854, 65.082980800520659, 34.205575508807939, 34.42143307899719, 65.366597668591353, 65.181966322650737, 46.667185190946562, 65.395095367847418, 38.178164768921633, 62.389518560881768, 63.257775434897205, 63.492063492063494, 64.766839378238345, 65.203216692023474, 65.825562260010969, 65.955809607562927, 65.897858319604609, 65.724613867893524, 65.868920847513451, 65.876152832674578, 65.796688233358921, 65.480737749645314, 65.645514223194752, 66.166740185266875, 66.042927903137041, 66.181336863004631, 66.144857237349797, 66.064743448579605, 65.876152832674578, 66.357000663570005, 65.767839526471562, 65.883386406061263, 65.963060686015822, 65.934065934065927, 66.122988759091911, 65.941312232113418, 65.832784726793946, 65.883386406061263, 65.782260717026645, 65.7102179388895, 65.919578114700059, 65.825562260010969, 66.159444260668209, 65.516488316226258, 65.659881812212745, 64.102564102564102, 65.402223675604972, 65.81112207963146, 64.329366355741399, 65.167807103290968, 65.245759025663332, 65.545116888791782, 65.602449158101905, 66.050198150594454, 65.245759025663332, 65.44502617801048, 65.631152920586302, 65.868920847513451, 64.970221981591777, 65.695828314902002, 65.22448092183933, 65.588106689986887, 64.871878040869291, 65.552277941658474, 65.941312232113418, 64.808813998703826, 65.267051017078217, 65.245759025663332, 65.847234416154521, 65.402223675604972, 65.963060686015822, 66.393714728339049, 66.152149944873202, 65.948560123103988, 65.919578114700059, 65.530799475753597, 66.144857237349797, 65.71741511500548, 65.502183406113531, 65.580937807410649, 66.13027664499063, 66.195939982347753, 66.021126760563391, 65.897858319604609, 65.516488316226258, 65.366597668591353, 65.602449158101905, 65.452165375804512, 65.502183406113531, 64.899945916711729, 64.027318322484263, 64.710957722174285, 65.760631302060503, 66.101134736146307, 65.86169045005488, 65.473592317765167, 65.210303227910003, 65.466448445171849, 66.181336863004631, 66.166740185266875, 65.739016106058941, 65.955809607562927, 65.203216692023474, 66.101134736146307, 65.623974625396485, 66.064743448579605, 66.195939982347753, 65.338124795818359, 65.231572080887148, 64.991334488734836, 65.63833278634722, 65.380843412880026, 65.775049331286993, 64.45375443119562, 66.03565925599824, 64.488392089423911, 65.63833278634722, 65.189048239895698, 65.480737749645314, 64.822817631806387, 65.167807103290968, 65.416484954208457, 65.402223675604972, 65.409353537555873, 65.437888537463195, 65.796688233358921, 64.267352185089976, 64.495324089003546, 64.794816414686821, 65.609622744669224, 65.63833278634722, 65.061808718282364, 65.281253400065282, 65.423617926071316, 65.005417118093177, 64.991334488734836, 65.153654034097087, 64.822817631806387, 64.977257959714095, 64.970221981591777, 64.047822374039285, 64.164260506897662, 65.2954619653934, 65.09710317890854, 64.857853205058916, 64.027318322484263, 64.613396510876584, 65.22448092183933, 65.352358130922553, 64.935064935064929, 65.416484954208457, 65.075921908893704, 64.530006453000652, 64.822817631806387, 63.986349578756531, 64.0, 63.959066197633511, 63.478628861616585, 64.745872450631268, 66.013862911211362, 66.291017567119653, 65.71741511500548, 65.81112207963146, 65.963060686015822, 66.115702479338836, 65.659881812212745, 65.948560123103988, 65.530799475753597, 66.101134736146307, 66.050198150594454, 65.941312232113418, 66.013862911211362, 65.695828314902002, 65.631152920586302, 65.905096660808439, 66.152149944873202, 66.006600660066013, 65.926821228436438, 66.101134736146307, 65.847234416154521, 66.101134736146307, 64.899945916711729, 64.836827317916573, 65.309676717100245, 65.054754418302068, 64.488392089423911, 64.467605028473187, 64.7878198898607, 64.391500321957508, 64.01365624666596, 64.047822374039285, 63.271116735210377, 65.259952142701763, 64.006827394922126, 65.480737749645314, 64.815815058874364, 64.676080629513848, 64.405324173465004, 64.662140316844486, 65.44502617801048, 65.402223675604972, 65.061808718282364, 65.409353537555873, 65.033600693691739, 65.588106689986887, 65.061808718282364, 65.912336592332196, 65.125366330185614, 65.616797900262469, 64.991334488734836, 65.516488316226258, 64.843834432076093, 64.752859917979706, 65.452165375804512, 65.782260717026645, 64.571674558760222, 65.423617926071316, 65.196131696186029, 65.111231687466088, 64.495324089003546, 65.040650406504071, 64.942093300140712, 64.65517241379311, 64.871878040869291, 64.808813998703826, 64.564726137953301, 65.416484954208457, 65.55944055944056, 65.80390436499232, 65.912336592332196, 65.7102179388895, 65.359477124183002, 66.02839220864972, 65.153654034097087, 65.338124795818359, 65.267051017078217, 64.509192559939791, 64.075181546347721, 65.753424657534254, 65.760631302060503, 66.217856748703227, 66.02839220864972, 65.883386406061263, 65.999340006599937, 66.101134736146307, 65.545116888791782, 65.775049331286993, 65.847234416154521, 65.955809607562927, 65.876152832674578, 65.703022339027598, 66.03565925599824, 65.818341377797282, 65.047701647875115, 64.683053040103488, 65.181966322650737, 65.984823490597165, 65.85446163977609, 65.999340006599937, 66.305669134711025, 65.78947368421052, 66.2763724732133, 65.840008778667837, 65.731814198071874, 65.631152920586302, 65.55944055944056, 65.181966322650737, 65.86169045005488, 66.115702479338836, 65.040650406504071, 65.181966322650737, 65.80390436499232, 65.63833278634722, 65.146579804560261, 65.530799475753597, 65.196131696186029, 65.373719764654609, 65.688635865995181, 65.487884741322858, 64.998375040623984, 64.963187527067987, 65.090041223692779, 65.387968613775058, 65.659881812212745, 65.832784726793946, 65.118298241805945, 64.516129032258064, 65.281253400065282, 65.160729800173769, 65.2954619653934, 65.595277140045908, 65.573770491803273, 65.160729800173769, 64.398411505849523, 65.395095367847418, 65.573770491803273, 65.090041223692779, 65.252854812398041, 64.857853205058916, 65.331010452961678, 65.167807103290968, 63.761955366631241, 57.498802108289411, 63.626723223753977, 63.728093467870423, 62.978902067807283, 64.2811227769445, 64.523066996451234, 63.599745601017595, 64.377682403433482, 64.095716269629307, 63.498782939993653, 57.915057915057915, 63.687506634115273, 65.825562260010969, 65.595277140045908, 65.876152832674578, 65.78947368421052, 65.919578114700059, 65.80390436499232, 65.281253400065282, 65.602449158101905, 65.588106689986887, 65.782260717026645, 64.343163538873995, 64.267352185089976, 64.191719268214399, 64.088869899594101, 63.606487861761906, 64.034151547492002, 64.253587491968304, 63.843370929985106, 64.46067898581866, 63.877355477483235, 59.868289762522451, 64.294899271324468, 65.890621568196792, 66.108417805200531, 66.166740185266875, 66.423115244104949, 66.072018500165171, 66.386368665633995, 65.941312232113418, 66.298342541436469, 66.02839220864972, 66.174037719201493, 65.760631302060503, 64.669109721922837, 65.373719764654609, 65.217391304347828, 64.061499039077518, 64.398411505849523, 65.316786414108421, 64.745872450631268, 64.599483204134373, 65.026552508941151, 64.412238325281805, 65.588106689986887, 64.780824875836743, 64.970221981591777, 65.580937807410649, 64.815815058874364, 65.01246072163832, 64.578624475298668, 65.2954619653934, 65.005417118093177, 64.913988964621879, 64.426071083431765, 65.132435953104647, 64.45375443119562, 64.913988964621879, 64.3707756678468, 64.86486486486487, 64.899945916711729, 65.160729800173769, 64.86486486486487, 64.71793765505339, 64.878892733564015, 65.118298241805945, 64.850843060959789, 65.068864548313627, 65.061808718282364, 64.906966681090438, 64.274236743438678, 64.662140316844486, 65.487884741322858, 63.870555673834367, 65.210303227910003, 63.9386189258312, 64.949123186836985, 64.836827317916573, 65.026552508941151, 65.054754418302068, 64.01365624666596, 65.338124795818359, 65.104166666666671, 65.181966322650737, 64.850843060959789, 65.09710317890854, 65.402223675604972, 64.935064935064929, 64.899945916711729, 65.537957400327684, 65.359477124183002, 65.203216692023474, 65.487884741322858, 65.217391304347828, 65.52364311455716, 65.480737749645314, 65.423617926071316, 64.86486486486487, 65.502183406113531, 65.331010452961678, 65.912336592332196, 66.03565925599824, 65.7102179388895, 65.580937807410649, 65.919578114700059, 65.883386406061263, 65.67425569176882, 65.17488594394959, 65.616797900262469, 64.377682403433482, 64.356966641638962, 65.681444991789817, 65.302568567696994, 65.068864548313627, 65.302568567696994, 65.090041223692779, 64.474532559638945, 65.238664781994132, 64.46067898581866], 'histories': 29985600.0, 'mean': 65.051139413615701}, 'compute-6-3.local': {'std': 0.47992153466436693, 'median': 65.026552508941151, 'rates': [64.662140316844486, 65.487884741322858, 63.870555673834367, 65.210303227910003, 63.9386189258312, 64.949123186836985, 64.836827317916573, 65.026552508941151, 65.054754418302068, 64.01365624666596, 65.338124795818359, 65.104166666666671, 65.181966322650737, 64.850843060959789, 65.09710317890854, 65.402223675604972, 64.935064935064929], 'histories': 1020000, 'mean': 64.87999465882821}, 'compute-4-18.local': {'std': 0.22292746987400008, 'median': 65.391547525127152, 'rates': [64.899945916711729, 65.537957400327684, 65.359477124183002, 65.203216692023474, 65.487884741322858, 65.217391304347828, 65.52364311455716, 65.480737749645314, 65.423617926071316, 64.86486486486487, 65.502183406113531, 65.331010452961678], 'histories': 720000, 'mean': 65.319327557760872}, 'compute-5-7.local': {'std': 0.15038065052247726, 'median': 65.897861499196722, 'rates': [65.912336592332196, 66.03565925599824, 65.7102179388895, 65.580937807410649, 65.919578114700059, 65.883386406061263], 'histories': 360000, 'mean': 65.840352685898651}, 'compute-5-20.local': {'std': 0.453406252190314, 'median': 65.238727255823292, 'rates': [65.67425569176882, 65.17488594394959, 65.616797900262469, 64.377682403433482, 64.356966641638962, 65.681444991789817, 65.302568567696994, 65.068864548313627, 65.302568567696994, 65.090041223692779], 'histories': 600000, 'mean': 65.164607648024344}, 'compute-4-20.local': {'std': 0.36352470094889511, 'median': 64.474532559638945, 'rates': [64.474532559638945, 65.238664781994132, 64.46067898581866], 'histories': 180000, 'mean': 64.724625442483912}})


def mon_par(mon):
    """Parse monitoring info"""
    histories=dict()
    mean=dict()
    std=dict()
    rates=dict()
    median=dict()
    if mon[0]==2 or mon[0]==4:
        nodes= mon[1]
        for i in nodes:
            for k in nodes[i]:
                data=nodes[i][k]
                if 'Histories' in k.capitalize():
                    histories[i]=data
                if 'Mean' in k.capitalize():
                    mean[i]=data
                if 'Std' in k.capitalize():
                    std[i]=data
                if 'Rates' in k.capitalize():
                    rates[i]=data
                if 'median' in k.capitalize():
                    median[i]=data
        


"""<?xml version='1.0'?>
<qhost xmlns:xsd="http://gridscheduler.svn.sourceforge.net/viewvc/gridscheduler/trunk/source/dist/util/resources/schemas/qhost/qhost.xsd?revision=11">
 <host name='global'>
   <hostvalue name='arch_string'>-</hostvalue>
   <hostvalue name='num_proc'>-</hostvalue>
   <hostvalue name='load_avg'>-</hostvalue>
   <hostvalue name='mem_total'>-</hostvalue>
   <hostvalue name='mem_used'>-</hostvalue>
   <hostvalue name='swap_total'>-</hostvalue>
   <hostvalue name='swap_used'>-</hostvalue>
 </host>
 <host name='client-4199'>
   <hostvalue name='arch_string'>linux-x64</hostvalue>
   <hostvalue name='num_proc'>1</hostvalue>
   <hostvalue name='load_avg'>0.00</hostvalue>
   <hostvalue name='mem_total'>252.8M</hostvalue>
   <hostvalue name='mem_used'>29.1M</hostvalue>
   <hostvalue name='swap_total'>0.0</hostvalue>
   <hostvalue name='swap_used'>0.0</hostvalue>
 </host>
 <host name='client-4200'>
   <hostvalue name='arch_string'>linux-x64</hostvalue>
   <hostvalue name='num_proc'>1</hostvalue>
   <hostvalue name='load_avg'>0.00</hostvalue>
   <hostvalue name='mem_total'>252.8M</hostvalue>
   <hostvalue name='mem_used'>29.1M</hostvalue>
   <hostvalue name='swap_total'>0.0</hostvalue>
   <hostvalue name='swap_used'>0.0</hostvalue>
 </host>
</qhost>"""
        
def xml_qhost(code):
    "Parse qhost xml info and returns available nodes"

    elements = tree.fromstring(code)
    nodes=0
    for sub in elements.iter():
        if(sub.tag == 'host'):
            
            hostname = sub.attrib['name']
            if 'global' not in hostname:
                nodes=nodes+1
                
    return nodes


    

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge