Example #1
0
def process(config, collector, out=sys.stdout):
    
    shareTable = dict()
    policyTable = dict()
    share_fkeys = dict()

    ldifList = DynSchedUtils.getLDIFFilelist(config, 'ComputingShare.ldif')
    
    for ldifFilename in ldifList:
        parseGLUETemplate(ldifFilename, shareTable, policyTable, share_fkeys)

    for shareDN in shareTable:
    
        shareData = shareTable[shareDN]
        policyData = share_fkeys[shareData.id]
        
        out.write("%s\n" % shareDN)
        
        nwait = collector.queuedJobsOnQueueForVO(shareData.mqueue, policyData.vo)
        nrun = collector.runningJobsOnQueueForVO(shareData.mqueue, policyData.vo)
        
        out.write("GLUE2ComputingShareRunningJobs: %d\n" % nrun)
        out.write("GLUE2ComputingShareWaitingJobs: %d\n" % nwait)
        out.write("GLUE2ComputingShareTotalJobs: %d\n" % (nrun + nwait))
                    
        if collector.isSetERT(shareData.mqueue):
            out.write("GLUE2ComputingShareEstimatedAverageWaitingTime: %d\n" % collector.getERT(shareData.mqueue))
        else:
            out.write("GLUE2ComputingShareEstimatedAverageWaitingTime: 0\n")
                        
        if collector.isSetWRT(shareData.mqueue):
            out.write("GLUE2ComputingShareEstimatedWorstWaitingTime: %d\n" % collector.getWRT(shareData.mqueue))
        else:
            out.write("GLUE2ComputingShareEstimatedWorstWaitingTime: 0\n")
                    
        nfreeSlots = collector.freeSlots(shareData.mqueue, policyData.vo)
        if nfreeSlots >= 0:
            out.write("GLUE2ComputingShareFreeSlots: %d\n" % nfreeSlots)
            
        out.write("\n")
Example #2
0
def process(config, collector, out=sys.stdout):

    glueCETable = dict()
    voViewTable = dict()
    ce_fkeys = dict()

    ldifList = DynSchedUtils.getLDIFFilelist(config, 'static-file-CE.ldif')
    
    for ldifFilename in ldifList:
        parseGLUETemplate(ldifFilename, glueCETable, voViewTable, ce_fkeys)

    for glueceDN in glueCETable:
    
        ceData = glueCETable[glueceDN]
        
        out.write("%s\n" % glueceDN)
        
        nwait = collector.queuedJobsOnQueue(ceData.queue)
        nrun = collector.runningJobsOnQueue(ceData.queue)
                
        out.write("GlueCEStateWaitingJobs: %d\n" % nwait)
        out.write("GlueCEStateRunningJobs: %d\n" % nrun)
        out.write("GlueCEStateTotalJobs: %d\n" % (nrun + nwait))
                    
        if collector.isSetERT(ceData.queue):
            out.write("GlueCEStateEstimatedResponseTime: %d\n" % collector.getERT(ceData.queue))
        else:
            out.write("GlueCEStateEstimatedResponseTime: 0\n")
                        
        if collector.isSetWRT(ceData.queue):
            out.write("GlueCEStateWorstResponseTime: %d\n" % collector.getWRT(ceData.queue))
        else:
            out.write("GlueCEStateWorstResponseTime: 0\n")
                    
        if collector.free >= 0:
            out.write("GlueCEStateFreeJobSlots: %d\n" % collector.free)
                    
        out.write("\n");
    

    for voviewDN in voViewTable:
        
        voData = voViewTable[voviewDN]

        out.write("%s\n" % voviewDN)
        
        if not voData.fkey in ce_fkeys:
            raise GLUE1Exception("Invalid foreign key for " + voviewDN)
                    
        queue = ce_fkeys[voData.fkey]
                    
        nwait = collector.queuedJobsOnQueueForVO(queue, voData.name)
        nrun = collector.runningJobsOnQueueForVO(queue, voData.name)
                    
        out.write("GlueCEStateWaitingJobs: %d\n" % nwait)
        out.write("GlueCEStateRunningJobs: %d\n" % nrun)
        out.write("GlueCEStateTotalJobs: %d\n" % (nrun + nwait))

        if collector.isSetERT(queue):
            out.write("GlueCEStateEstimatedResponseTime: %d\n" % collector.getERT(queue))
        else:
            out.write("GlueCEStateEstimatedResponseTime: 0\n")
                    
        if collector.isSetWRT(queue):
            out.write("GlueCEStateWorstResponseTime: %d\n" % collector.getWRT(queue))
        else:
            out.write("GlueCEStateWorstResponseTime: 0\n")
                    
        nfreeSlots = collector.freeSlots(queue, voData.name)
        if nfreeSlots >= 0:
            out.write("GlueCEStateFreeJobSlots: %d\n" % nfreeSlots)

        out.write("\n");