ajack       2003/09/08 11:13:11

  Modified:    python/gump context.py statistics.py document.py
               .        gumpy.sh
  Log:
  1) Output forrest.txt and check_forrest.txt from gumpy 
  (this is to aid to debug forrest not working, since real debug is in xdocs..)
  
  2) Added more workspace 'details' to xdocs, e.g.
  
  baedir, tmpdir, scratchdir, logdir, packagedir, and others.
  
  3) Added statistics for "by FOG Factor".
  
  Note: FOG Factor is next to meaningless right now, it is a simple algorythm
  currently scoring failed gumpy runs not failed project runs.
  
  Revision  Changes    Path
  1.3       +19 -0     jakarta-gump/python/gump/context.py
  
  Index: context.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/context.py,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- context.py        5 Sep 2003 05:20:42 -0000       1.2
  +++ context.py        8 Sep 2003 18:13:11 -0000       1.3
  @@ -481,6 +481,13 @@
       def dependeeCount(self):         
           return len(self.getDependees())   
                
  +    def getFOGFactor(self):
  +        fogFactor=0
  +        if hasattr(self,'stats'):
  +             fogFactor = self.stats.getFOGFactor()
  +        return fogFactor
  +            
  +        return round(fogFactor/fogFactors,2)
       def propagateState(self,state,reason=REASON_UNSET,cause=None):
           if stateUnsetOrOk(self.status):
               Context.propagateState(self,state,reason,cause)
  @@ -558,6 +565,18 @@
               
       def dependencyCount(self):         
           return len(self.getDepends())   
  +        
  +    def getFOGFactor(self):
  +        fogFactor=0
  +        fogFactors=0
  +        for ctxt in self:
  +                subFOGFactor = ctxt.getFOGFactor()
  +                fogFactors += 1
  +                
  +        if not fogFactors:
  +            fogFactors=1 # 0/1 is better than 0/0
  +            
  +        return round(fogFactor/fogFactors,2)
           
   class GumpContext(Context):
       """Gump Run Context"""
  
  
  
  1.2       +7 -1      jakarta-gump/python/gump/statistics.py
  
  Index: statistics.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/statistics.py,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- statistics.py     29 Aug 2003 00:20:22 -0000      1.1
  +++ statistics.py     8 Sep 2003 18:13:11 -0000       1.2
  @@ -301,7 +301,12 @@
   def sortByDependeeCount(mctxt1,mctxt2):
       count1=mctxt1.dependeeCount()
       count2=mctxt2.dependeeCount()
  -    return count2 - count1                
  +    return count2 - count1          
  +    
  +def sortByFOGFactor(mctxt1,mctxt2):
  +    fog1=mctxt1.getFOGFactor()
  +    fog2=mctxt2.getFOGFactor()
  +    return int(round(fog2 - fog1,0))                
               
   class StatisticsGuru:
       """ Know it all ... """
  @@ -317,6 +322,7 @@
           
self.modulesByProjectCount=orderedList(context.subcontexts.values(),sortByProjectCount)
           
self.modulesByTotalDependencies=orderedList(context.subcontexts.values(),sortByDependencyCount)
           
self.modulesByTotalDependees=orderedList(context.subcontexts.values(),sortByDependeeCount)
  +        
self.modulesByFOGFactor=orderedList(context.subcontexts.values(),sortByFOGFactor)
      
           
   #        calculate()
  
  
  
  1.10      +42 -2     jakarta-gump/python/gump/document.py
  
  Index: document.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document.py,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- document.py       7 Sep 2003 20:59:34 -0000       1.9
  +++ document.py       8 Sep 2003 18:13:11 -0000       1.10
  @@ -275,6 +275,17 @@
       titledDataInTableXDoc(x,"Status : ", stateName(context.status))    
       (hours, mins, secs)      = context.elapsedTime();
       titledDataInTableXDoc(x,"Elapsed Time : ", str(hours) + ':' + str(mins) + ':' + 
str(secs))
  +    titledDataInTableXDoc(x,"Base Directory : ", str(workspace.basedir))
  +    titledDataInTableXDoc(x,"Temporary Directory : ", str(workspace.tmpdir))
  +    titledDataInTableXDoc(x,"Scratch Directory : ", str(workspace.scratchdir))    
  +    # :TODO: We have duplicate dirs? tmp = scratch?
  +    titledDataInTableXDoc(x,"Log Directory : ", str(workspace.logdir))
  +    titledDataInTableXDoc(x,"CVS Directory : ", str(workspace.cvsdir))
  +    titledDataInTableXDoc(x,"Package Directory : ", str(workspace.pkgdir))
  +    titledDataInTableXDoc(x,"Email Address: ", str(workspace.email))
  +    titledDataInTableXDoc(x,"Email Server: ", str(workspace.mailserver))
  +    titledDataInTableXDoc(x,"Prefix: ", str(workspace.prefix))
  +    titledDataInTableXDoc(x,"Signature: ", str(workspace.signature))
       endTableXDoc(x)
       endSectionXDoc(x)       
       
  @@ -380,7 +391,7 @@
           addItemXDoc(x,"Cause:", "<link href='%s'>%s</link>" % \
               (getContextUrl(projectcontext.cause), projectcontext.cause.name))
       addItemXDoc(x,"Elapsed: ", str(projectcontext.elapsedSecs()))
  -    addItemXDoc(x,"FOG Factor: ", str(stats.getFOGFactor()))
  +    addItemXDoc(x,"FOG Factor: ", str(round(stats.getFOGFactor(),2)))
       addItemXDoc(x,"Successes: ", str(stats.successes))
       addItemXDoc(x,"Failures: ", str(stats.failures))
       addItemXDoc(x,"Prerequisite Failures: ", str(stats.prereqs))
  @@ -555,6 +566,9 @@
       
       
       x.write('    <p>\n')
  +    addLinkXDoc(x, 'fogfactor.html', 'Modules By FOG Factor') 
  +    x.write('    </p>\n')
  +    x.write('    <p>\n')
       addLinkXDoc(x, 'elapsed.html', 'Modules By Elapsed Time') 
       x.write('    </p>\n')
       x.write('    <p>\n')
  @@ -574,6 +588,7 @@
       documentModulesByProjects(stats, sdir, moduleFilterList)
       documentModulesByDependencies(stats, sdir, moduleFilterList)
       documentModulesByDependees(stats, sdir, moduleFilterList)
  +    documentModulesByFOGFactor(stats, sdir, moduleFilterList)
       
   
   def documentModulesByElapsed(stats,sdir,moduleFilterList=None):
  @@ -664,6 +679,31 @@
       footerXDoc(x)
       endXDoc(x)
       
  +def documentModulesByFOGFactor(stats,sdir,moduleFilterList=None):
  +    x=startXDoc(os.path.join(sdir,'fogfactor.xml'))
  +    headerXDoc(x, 'Modules By FOG Factor')
  +    
  +    startTableXDoc(x,'Modules By FOG Factor')
  +    for mctxt in stats.modulesByFOGFactor:        
  +        if moduleFilterList and not mctxt.module in moduleFilterList: continue    
  +        startTableRowXDoc(x)
  +        insertTableHeaderXDoc(x,mctxt.name)
  +        insertTableDataXDoc(x, str(round(mctxt.getFOGFactor(),2)))
  +        
  +        projectsString=''
  +        for pctxt in mctxt.getDependees():
  +            projectsString+=pctxt.name
  +            projectsString+='='            
  +            projectsString+=str(round(pctxt.getFOGFactor(),2))
  +            projectsString+='  '            
  +        insertTableDataXDoc(x, projectsString)
  +        
  +        endTableRowXDoc(x)
  +    endTableXDoc(x)
  +    
  +    footerXDoc(x)
  +    endXDoc(x)
  +    
    
   #####################################################################           
   #
  @@ -866,7 +906,7 @@
   def titledDataInTableXDoc(f,title,data):
       startTableRowXDoc(f)
       insertTableDataXDoc(f,'<strong>%s</strong>' % (title))
  -    insertTableDataXDoc(f, data)
  +    insertTableDataXDoc(f, escape(data))
       endTableRowXDoc(f)
       
   def endTableXDoc(f):
  
  
  
  1.5       +6 -0      jakarta-gump/gumpy.sh
  
  Index: gumpy.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/gumpy.sh,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- gumpy.sh  8 Sep 2003 16:33:51 -0000       1.4
  +++ gumpy.sh  8 Sep 2003 18:13:11 -0000       1.5
  @@ -131,6 +131,12 @@
   # 
   cd $GUMP_TMP
   echo $SEPARATOR >> $GUMP_LOG
  +if [ -f check_forrest.txt ] ; then
  +     cat check_forrest.txt >> $GUMP_LOG
  +else
  +     echo "No Forrest Output file @ $GUMP_TMP/check_forrest.txt" >> $GUMP_LOG
  +fiecho $SEPARATOR >> $GUMP_LOG
  +
   if [ -f forrest.txt ] ; then
        cat forrest.txt >> $GUMP_LOG
   else
  @@ -145,10 +151,18 @@
   pkill -P $$ 
   
   # $Log$
  -# Revision 1.4  2003/09/08 16:33:51  ajack
  -# 1) Moved gumpy.html (run output) to log not log/site
  -# 2) Cat the output of forrest.txt (if it exists) in case forrest isn't building 
the site.
  -# 3) Increased version number to 1.0.2
  +# Revision 1.5  2003/09/08 18:13:11  ajack
  +# 1) Output forrest.txt and check_forrest.txt from gumpy 
  +# (this is to aid to debug forrest not working, since real debug is in xdocs..)
  +# 
  +# 2) Added more workspace 'details' to xdocs, e.g.
  +# 
  +# baedir, tmpdir, scratchdir, logdir, packagedir, and others.
  +# 
  +# 3) Added statistics for "by FOG Factor".
  +# 
  +# Note: FOG Factor is next to meaningless right now, it is a simple algorythm
  +# currently scoring failed gumpy runs not failed project runs.
   #
   # Revision 1.2  2003/05/30 22:02:56  nickchalko
   # Fixing incomplete update from Adam
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to