def LoadReports( self, aPool, aHour, aDate, aMonth, aYear ): gc.collect() self.iReportCache = {} url_mid = TimeToDir( aHour, aDate, aMonth, aYear ) + '/' + aPool + '/' for site in SITE_MAP.keys(): reportIndx = SITE_MAP[site] + url_mid self.iReportCache[site] = SuperCALSiteReport( reportIndx ) for worker in self.iReportCache.values(): worker.GetReports()
def GetLogSize( self, aSite, aPool, aHour, aDate, aMonth, aYear ): if aSite not in SITE_MAP.keys(): return 0 url_mid = '%s/%s/' % ( TimeToDir( aHour, aDate, aMonth, aYear ), aPool ) home_pg = SITE_MAP[aSite] + url_mid try: urlFiH = urllib.urlopen( home_pg ) if urlFiH.getcode() == 200: pageContent = urlFiH.readlines() urlFiH.close() for line in pageContent: mObj = re.search( FILE_SIZE_PATTERN, line ) if mObj: return int( mObj.group( 1 ) ) * 1024 except: return 0
def GetHBeat( self, aSite, aMachine, aHBeat, aStat ): if aSite in SITE_MAP.keys(): return self.iReportCache[aSite].GetHBeat( aMachine, aHBeat, aStat ) return None
def GetEventList( self, aSite ): if aSite in SITE_MAP.keys(): return self.iReportCache[aSite].GetEventList() return []
def GetEvtNames( self, aSite, aType ): if aSite in SITE_MAP.keys(): return self.iReportCache[aSite].GetEvtNames( aType ) return []
def GetEvent( self, aSite, aType, aName ): if aSite in SITE_MAP.keys(): return self.iReportCache[aSite].GetEvent( aType, aName ) return None