예제 #1
0
 def GetHBeat( self, aMachine, aHBeat, aStat ):
     for hbmsg in self.iHBtCSV:
         if len( hbmsg ) > 9 and hbmsg[2] == aMachine and hbmsg[3] == aHBeat and hbmsg[4] == aStat:
             retObj = SuperCALMessage()
             retObj.iTotlCount = float( hbmsg[6] )
             retObj.iHtBtCount = float( hbmsg[5] )
             retObj.iMaximTime = float( hbmsg[8] )
             retObj.iAvergTime = float( hbmsg[9] )
             retObj.iFailCount = 0.0
             retObj.iAvgFlTime = 0.0
             return retObj
     return None
예제 #2
0
 def GetStat( self, aType, aName, aXML ):
     calMsg = SuperCALMessage()
     if aName[-1] == '*':
         calMsg.iTotlCount = GetCountFromName( aType, aName[:-1], aXML )
     else:
         msgXML = GetTypeNameXML( aType, aName, aXML )
         if msgXML:
             calMsg.iTotlCount = GetMetric( msgXML, 'totalCount' )
             calMsg.iFailCount = GetMetric( msgXML, 'failureCount' )
             calMsg.iAvergTime = GetMetric( msgXML, 'avgDuration' )
             calMsg.iMaximTime = GetMetric( msgXML, 'maxDuration' )
             calMsg.iAvgFlTime = GetMetric( msgXML, 'avgFailureDuration' )
     return calMsg