Changeset 32587
- Timestamp:
- Oct 28, 2011, 11:38:48 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/ippToPsps/jython/metrics.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippToPsps/jython/metrics.py
r32495 r32587 76 76 numPending = len(pending) 77 77 78 #if stage == ' processed':78 #if stage == 'merge_worthy' and batchType == "P2": 79 79 # for n in pending: print n 80 80 … … 85 85 print >> DATFILE, stage, numSuccess, numFail, numPending 86 86 87 if stage == 'processed': numPendingProcessed = numPending 88 87 89 sys.stdout.write("|\n") 88 90 plotMe(batchType, tempFilename) 89 91 DATFILE.close() 92 93 return numPendingProcessed 90 94 91 95 ''' … … 103 107 def printStats(batchType): 104 108 109 rate = ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "1 HOUR") / 1.0 110 105 111 logger.info("| %2s | %16.1f | %13d | %17.1f | %16d | %14s |" % 106 112 (batchType, 107 ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "1 HOUR") / 1.0,113 rate, 108 114 ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "24 HOUR"), 109 115 ippToPspsDb.countBatchesInLastPeriod(batchType, EPOCH, DVOLABEL, "1 WEEK") / 7.0, 110 116 ippToPspsDb.getTotalDetectionsPublished(batchType, EPOCH, DVOLABEL), 111 117 ippToPspsDb.getTimeOfLastBatchPublished(batchType, EPOCH, DVOLABEL))) 118 119 return rate 112 120 113 121 ''' … … 137 145 138 146 DVOLABEL = 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 pass146 147 147 EPOCH = configDoc.find("options/epoch").text 148 148 … … 152 152 logger.infoPair("DVO label", DVOLABEL) 153 153 154 try: 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)) 160 except: 161 pass 162 163 154 164 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 155 165 logger.info("|Type| batches per hour | last 24 hours | per day this week | total detections | last published |") 156 166 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 157 printStats("P2")158 printStats("ST")167 rateP2 = printStats("P2") 168 rateST = printStats("ST") 159 169 logger.info("+----+------------------+---------------+-------------------+------------------+----------------+") 160 170 … … 171 181 sys.stdout.write("|\n") 172 182 writetableSeparator(colCount) 173 p rintTableRow(stages, "P2")174 p rintTableRow(stages, "ST")183 pendP2Processed = printTableRow(stages, "P2") 184 pendSTProcessed = printTableRow(stages, "ST") 175 185 writetableSeparator(colCount) 176 186 187 logger.info("") 188 try: logger.infoPair("Estimated time for P2s", "%.1f hours" % (pendP2Processed / rateP2)) 189 except: pass 190 try: logger.infoPair("Estimated time for STs", "%.1f hours" % (pendSTProcessed / rateST)) 191 except: pass
Note:
See TracChangeset
for help on using the changeset viewer.
