Omaha #3296 A few more minor performance tweaks and some addtional logging.

Change-Id: Iab603f6f7420a11c5c5cae82df7ebb96f66b0945
(cherry picked from commit 9e6a14877578177e4cfb0c5698097750bde6f280)

Former-commit-id: 4123073c4e [formerly c7a74ab5b1 [formerly 2c5f910f90] [formerly 4123073c4e [formerly a0384ccfb30a877f14893c6cfa62d92117c0bb87]]]
Former-commit-id: c7a74ab5b1 [formerly 2c5f910f90]
Former-commit-id: c7a74ab5b1
Former-commit-id: 319819d3a7
This commit is contained in:
Ron Anderson 2014-06-24 10:06:54 -05:00 committed by Brian.Dyke
parent 7f669f7841
commit 75b719bb01
2 changed files with 36 additions and 16 deletions

View file

@ -333,15 +333,15 @@ def mergeFromJava(siteId, activeTable, newRecords, logger, mode, offsetSecs=0):
logger.info("Updated " + mode + " Active Table: decoded\n" +
active.printActiveTable(decoded, combine=1))
updatedList = ArrayList()
updatedList = ArrayList(len(updatedTable))
for x in updatedTable:
updatedList.add(x.javaRecord())
purgedList = ArrayList()
purgedList = ArrayList(len(purgeRecords))
for x in purgeRecords:
purgedList.add(x.javaRecord())
changeList = ArrayList()
changeList = ArrayList(len(changes))
if (changedFlag):
from com.raytheon.uf.common.activetable import VTECChange
for c in changes:

View file

@ -1,19 +1,19 @@
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non-U.S. persons whether in the United States or abroad requires
# an export license or other authorization.
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# Contractor Name: Raytheon Company
# Contractor Address: 6825 Pine Street, Suite 340
# Mail Stop B8
# Omaha, NE 68106
# 402.291.0100
#
# See the AWIPS II Master Rights File ("Master Rights File.pdf") for
# further licensing information.
##
@ -23,10 +23,16 @@
# Date Ticket# Engineer Description
# ------------ ---------- ----------- --------------------------
# 06/17/13 #3296 randerso Default debug to False to avoid logging overhead
# Added performance logging
#
import os, sys, time, copy, LogStream
from com.raytheon.uf.common.time.util import TimeUtil
from com.raytheon.uf.common.status import PerformanceStatus
perfStat = PerformanceStatus.getHandler("ActiveTable")
timer = TimeUtil.getTimer()
# This class takes a VTEC active table and eliminates unnecessary
# records. Records purged consist of old SPC watches, old Tropical
# events, last year's records, and extraneous records not needed for
@ -49,7 +55,11 @@ class VTECTableSqueeze:
LogStream.logDebug(self.__printActiveTable(table))
# modify old UFN events (in case fcstrs didn't CAN them)
timer.reset()
timer.start()
table, modTable = self.__modifyOldUFNEvents(table)
timer.stop()
perfStat.logDuration("updateActiveTable squeeze __modifyOldUFNEvents", timer.getElapsedTime());
if self.__debug:
LogStream.logDebug("************** MOD UFN TABLE *********************")
for old, new in modTable:
@ -58,8 +68,12 @@ class VTECTableSqueeze:
LogStream.logDebug(" -----------")
# remove the national center and short fused events
timer.reset()
timer.start()
shortWFO, shortNC, purgeT = \
self.__removeOldNationalAndShortFusedEvents(table)
timer.stop()
perfStat.logDuration("updateActiveTable squeeze __removeOldNationalAndShortFusedEvents", timer.getElapsedTime());
if self.__debug:
LogStream.logDebug("************** SHORT WFO TABLE *********************")
LogStream.logDebug(self.__printActiveTable(shortWFO))
@ -69,10 +83,18 @@ class VTECTableSqueeze:
LogStream.logDebug(self.__printActiveTable(purgeT))
# separate out the shortWFO into dictionary structure
timer.reset()
timer.start()
dict = self.__separateTable(shortWFO)
timer.stop()
perfStat.logDuration("updateActiveTable squeeze __separateTable", timer.getElapsedTime());
# purge old entries with LowerETNs that aren't in effect
timer.reset()
timer.start()
shorterT, purgeT2 = self.__purgeOldEntriesWithLowerETNs(dict)
timer.stop()
perfStat.logDuration("updateActiveTable squeeze __purgeOldEntriesWithLowerETNs", timer.getElapsedTime());
if self.__debug:
LogStream.logDebug("************** TRIMMED WFO TABLE ******************")
LogStream.logDebug(self.__printActiveTable(shorterT))
@ -80,12 +102,10 @@ class VTECTableSqueeze:
LogStream.logDebug(self.__printActiveTable(purgeT2))
#add in any shortNC entries to final table
for r in shortNC:
shorterT.append(r)
shorterT.extend(shortNC)
#add in the purged entries from before
for r in purgeT2:
purgeT.append(r)
purgeT.extend(purgeT2)
if self.__debug:
LogStream.logDebug("************** FINAL TABLE ********************")