IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 28, 2011, 11:38:48 AM (15 years ago)
Author:
rhenders
Message:

Now makes an estimate of remaining time required to complete processing of each batch type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/metrics.py

    r32495 r32587  
    7676       numPending = len(pending)
    7777
    78        #if stage == 'processed':
     78       #if stage == 'merge_worthy' and batchType == "P2":
    7979       #    for n in pending: print n
    8080
     
    8585       print >> DATFILE, stage, numSuccess, numFail, numPending
    8686
     87       if stage == 'processed': numPendingProcessed = numPending
     88
    8789    sys.stdout.write("|\n")
    8890    plotMe(batchType, tempFilename)
    8991    DATFILE.close()
     92
     93    return numPendingProcessed
    9094
    9195'''
     
    103107def printStats(batchType):
    104108
     109    rate = ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "1 HOUR") / 1.0
     110
    105111    logger.info("| %2s | %16.1f | %13d | %17.1f | %16d | %14s |" %
    106112            (batchType,
    107              ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "1 HOUR") / 1.0,
     113             rate,
    108114             ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "24 HOUR"),
    109115             ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "1 WEEK") / 7.0,
    110116             ippToPspsDb.getTotalDetectionsPublished(batchType, EPOCH, DVOLABEL),
    111117             ippToPspsDb.getTimeOfLastBatchPublished(batchType, EPOCH, DVOLABEL)))
     118
     119    return rate
    112120
    113121'''
     
    137145
    138146DVOLABEL = configDoc.find("dvo/gpc1Label").text
    139 try:
    140     MINRA = float(configDoc.find("dvo/minRA").text)
    141     MAXRA = float(configDoc.find("dvo/maxRA").text)
    142     MINDEC = float(configDoc.find("dvo/minDec").text)
    143     MAXDEC = float(configDoc.find("dvo/maxDec").text)
    144 except:
    145     pass
    146    
    147147EPOCH = configDoc.find("options/epoch").text
    148148
     
    152152logger.infoPair("DVO label", DVOLABEL)
    153153
     154try:
     155    MINRA = float(configDoc.find("dvo/minRA").text)
     156    MAXRA = float(configDoc.find("dvo/maxRA").text)
     157    MINDEC = float(configDoc.find("dvo/minDec").text)
     158    MAXDEC = float(configDoc.find("dvo/maxDec").text)
     159    logger.infoPair("Coordinates", "%.1f to %.1f RA, %.1f to %.1f Dec" % (MINRA, MAXRA, MINDEC, MAXDEC))
     160except:
     161    pass
     162   
     163
    154164logger.info("+----+------------------+---------------+-------------------+------------------+----------------+")
    155165logger.info("|Type| batches per hour | last 24 hours | per day this week | total detections | last published |")
    156166logger.info("+----+------------------+---------------+-------------------+------------------+----------------+")
    157 printStats("P2")
    158 printStats("ST")
     167rateP2 = printStats("P2")
     168rateST = printStats("ST")
    159169logger.info("+----+------------------+---------------+-------------------+------------------+----------------+")
    160170
     
    171181sys.stdout.write("|\n")
    172182writetableSeparator(colCount)
    173 printTableRow(stages, "P2")
    174 printTableRow(stages, "ST")
     183pendP2Processed = printTableRow(stages, "P2")
     184pendSTProcessed = printTableRow(stages, "ST")
    175185writetableSeparator(colCount)
    176186
     187logger.info("")
     188try: logger.infoPair("Estimated time for P2s", "%.1f hours" % (pendP2Processed / rateP2))
     189except: pass
     190try: logger.infoPair("Estimated time for STs", "%.1f hours" % (pendSTProcessed / rateST))
     191except: pass
Note: See TracChangeset for help on using the changeset viewer.