gump-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject cvs commit: jakarta-gump/python/gump/document forrest.py
Date Fri, 12 Dec 2003 16:32:51 GMT
ajack       2003/12/12 08:32:51

  Modified:    python/gump/output statsdb.py
               python/gump/model module.py project.py
               python/gump/utils launcher.py
               python/gump/document forrest.py
  Log:
  1) Take Stefan's advice on not doing \\ on M$ [removed for all platforms for now]
  2) Add more statistics (project to match module)
  
  Revision  Changes    Path
  1.4       +82 -18    jakarta-gump/python/gump/output/statsdb.py
  
  Index: statsdb.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/output/statsdb.py,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- statsdb.py	3 Dec 2003 18:36:13 -0000	1.3
  +++ statsdb.py	12 Dec 2003 16:32:50 -0000	1.4
  @@ -353,8 +353,12 @@
           #
           self.averageProjectsPerModule=	\
               round(self.projectsInWorkspace/self.modulesInWorkspace,2)
  +            
  +#
  +# Module Comparisons
  +#            
           
  -def sortByElapsed(module1,module2):
  +def compareModulesByElapsed(module1,module2):
       elapsed1=module1.getElapsedSecs()
       elapsed2=module2.getElapsedSecs()
       c = 0
  @@ -363,48 +367,97 @@
       if not c: c=cmp(module1,module2)
       return c
   
  -def sortByProjectCount(module1,module2):
  +def compareModulesByProjectCount(module1,module2):
       count1=len(module1.getProjects())
       count2=len(module2.getProjects())
       c = count2 - count1                  
       if not c: c=cmp(module1,module2)
       return c
   
  -def sortByDependencyCount(module1,module2):
  -    count1=module1.dependencyCount()
  -    count2=module2.dependencyCount()
  +def compareModulesByDependencyCount(module1,module2):
  +    count1=module1.getDependencyCount()
  +    count2=module2.getDependencyCount()
       c= count2 - count1                 
       if not c: c=cmp(module1,module2)
       return c        
           
  -def sortByDependeeCount(module1,module2):
  -    count1=module1.dependeeCount()
  -    count2=module2.dependeeCount()
  +def compareModulesByDependeeCount(module1,module2):
  +    count1=module1.getDependeeCount()
  +    count2=module2.getDependeeCount()
       c= count2 - count1                  
       if not c: c=cmp(module1,module2)
       return c       
       
  -def sortByFOGFactor(module1,module2):
  +def compareModulesByFOGFactor(module1,module2):
       fog1=module1.getFOGFactor()
       fog2=module2.getFOGFactor()
       c= int(round(fog2 - fog1,0))                  
       if not c: c=cmp(module1,module2)
       return c             
               
  -def sortByFOGFactor(module1,module2):
  +def compareModulesByFOGFactor(module1,module2):
       fog1=module1.getFOGFactor()
       fog2=module2.getFOGFactor()
       c= int(round(fog2 - fog1,0))                  
       if not c: c=cmp(module1,module2)
       return c             
               
  -def sortByLastUpdated(module1,module2):
  +def compareModulesByLastUpdated(module1,module2):
       fog1=module1.getLastUpdated()
       fog2=module2.getLastUpdated()
       c= int(round(fog2 - fog1,0))                  
       if not c: c=cmp(module1,module2)
       return c             
               
  +#
  +# Project Comparisons
  +#            
  +        
  +
  +def compareProjectsByElapsed(project1,project2):
  +    elapsed1=project1.getElapsedSecs()
  +    elapsed2=project2.getElapsedSecs()
  +    c = 0
  +    if elapsed1 > elapsed2: c = -1
  +    if elapsed1 < elapsed2: c = 1       
  +    if not c: c=cmp(project1,project2)
  +    return c
  +
  +def compareProjectsByDependencyCount(project1,project2):
  +    count1=project1.getDependencyCount()
  +    count2=project2.getDependencyCount()
  +    c= count2 - count1                 
  +    if not c: c=cmp(project1,project2)
  +    return c        
  +        
  +def compareProjectsByDependeeCount(project1,project2):
  +    count1=project1.getDependeeCount()
  +    count2=project2.getDependeeCount()
  +    c= count2 - count1                  
  +    if not c: c=cmp(project1,project2)
  +    return c       
  +    
  +def compareProjectsByFOGFactor(project1,project2):
  +    fog1=project1.getFOGFactor()
  +    fog2=project2.getFOGFactor()
  +    c= int(round(fog2 - fog1,0))                  
  +    if not c: c=cmp(project1,project2)
  +    return c             
  +            
  +def compareProjectsByFOGFactor(project1,project2):
  +    fog1=project1.getFOGFactor()
  +    fog2=project2.getFOGFactor()
  +    c= int(round(fog2 - fog1,0))                  
  +    if not c: c=cmp(project1,project2)
  +    return c             
  +            
  +def compareProjectsByLastUpdated(project1,project2):
  +    fog1=project1.getLastUpdated()
  +    fog2=project2.getLastUpdated()
  +    c= int(round(fog2 - fog1,0))                  
  +    if not c: c=cmp(project1,project2)
  +    return c                         
  +            
   class StatisticsGuru:
       """ Know it all ... """
       
  @@ -412,11 +465,22 @@
           self.workspace=workspace
           
           # One for the whole workspace
  -        self.wguru=WorkspaceStatisticsGuru(workspace)                
  -        self.modulesByElapsed=createOrderedList(workspace.getModules(),sortByElapsed)
  -        self.modulesByProjectCount=createOrderedList(workspace.getModules(),sortByProjectCount)
  -        self.modulesByTotalDependencies=createOrderedList(workspace.getModules(),sortByDependencyCount)
  -        self.modulesByTotalDependees=createOrderedList(workspace.getModules(),sortByDependeeCount)
  -        self.modulesByFOGFactor=createOrderedList(workspace.getModules(),sortByFOGFactor)
  -        self.modulesByLastUpdated=createOrderedList(workspace.getModules(),sortByLastUpdated)
  +        self.wguru=WorkspaceStatisticsGuru(workspace)      
  +        
  +        # All Modules          
  +        self.modulesByElapsed=createOrderedList(workspace.getModules(),compareModulesByElapsed)
  +        self.modulesByProjectCount=createOrderedList(workspace.getModules(),compareModulesByProjectCount)
  +        self.modulesByTotalDependencies=createOrderedList(workspace.getModules(),compareModulesByDependencyCount)
  +        self.modulesByTotalDependees=createOrderedList(workspace.getModules(),compareModulesByDependeeCount)
  +        self.modulesByFOGFactor=createOrderedList(workspace.getModules(),compareModulesByFOGFactor)
  +        self.modulesByLastUpdated=createOrderedList(workspace.getModules(),compareModulesByLastUpdated)
  +        
  +        
  +        
  +        # All Projects                
  +        self.projectsByElapsed=createOrderedList(workspace.getProjects(),compareProjectsByElapsed)
  +        self.projectsByTotalDependencies=createOrderedList(workspace.getProjects(),compareProjectsByDependencyCount)
  +        self.projectsByTotalDependees=createOrderedList(workspace.getProjects(),compareProjectsByDependeeCount)
  +        self.projectsByFOGFactor=createOrderedList(workspace.getProjects(),compareProjectsByFOGFactor)
  +        self.projectsByLastUpdated=createOrderedList(workspace.getProjects(),compareProjectsByLastUpdated)
           
  
  
  
  1.21      +2 -2      jakarta-gump/python/gump/model/module.py
  
  Index: module.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/module.py,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- module.py	1 Dec 2003 21:23:20 -0000	1.20
  +++ module.py	12 Dec 2003 16:32:50 -0000	1.21
  @@ -376,7 +376,7 @@
           self.totalDependees.sort()
           return self.totalDependees
               
  -    def dependeeCount(self):         
  +    def getDependeeCount(self):         
           return len(self.getDependees())   
               
       def getDepends(self):   
  @@ -392,7 +392,7 @@
           self.totalDepends.sort()
           return self.totalDepends
               
  -    def dependencyCount(self):         
  +    def getDependencyCount(self):         
           return len(self.getDepends())   
           
       def getFOGFactor(self):
  
  
  
  1.23      +5 -0      jakarta-gump/python/gump/model/project.py
  
  Index: project.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/model/project.py,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- project.py	3 Dec 2003 18:36:13 -0000	1.22
  +++ project.py	12 Dec 2003 16:32:50 -0000	1.23
  @@ -338,6 +338,10 @@
       def getFOGFactor(self):
           return self.getStats().getFOGFactor()
           
  +    # Only modules get updated.
  +    def getLastUpdated(self):
  +        return self.getModule().getStats().getLastUpdated()  
  +        
       def determineAffected(self):
           affected=0
           
  @@ -742,6 +746,7 @@
           #	This sets the *defaults*, a workspace could override them.
           #
           cmd.addPrefixedParameter('-D','build.sysclasspath','only','=')
  +        cmd.addPrefixedParameter('-D','build.clonevm','true','=')
       
           # These are module level plus project level
           cmd.addNamedParameters(properties)
  
  
  
  1.5       +3 -2      jakarta-gump/python/gump/utils/launcher.py
  
  Index: launcher.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/utils/launcher.py,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- launcher.py	11 Dec 2003 18:56:26 -0000	1.4
  +++ launcher.py	12 Dec 2003 16:32:51 -0000	1.5
  @@ -192,8 +192,9 @@
           
       def getEscapedEntry(self,entry):
           if not entry: return
  -        escapedEntry=entry.replace(default.shellEscape,default.shellEscape+default.shellEscape)
       
  -        escapedEntry=escapedEntry.replace(default.shellQuote,default.shellEscape+default.shellQuote)
  +        # Try without escape escape for now...
  +        #escapedEntry=entry.replace(default.shellEscape,default.shellEscape+default.shellEscape)
       
  +        escapedEntry=entry.replace(default.shellQuote,default.shellEscape+default.shellQuote)
           return escapedEntry
           
       def items(self):
  
  
  
  1.36      +94 -17    jakarta-gump/python/gump/document/forrest.py
  
  Index: forrest.py
  ===================================================================
  RCS file: /home/cvs/jakarta-gump/python/gump/document/forrest.py,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- forrest.py	11 Dec 2003 18:56:27 -0000	1.35
  +++ forrest.py	12 Dec 2003 16:32:51 -0000	1.36
  @@ -1395,6 +1395,11 @@
           
           document=XDocDocument('Statistics',self.resolver.getFile(stats))
           
  +        document.createParagraph("""
  +        Statistics from Gump show the depth and health of relationship. 
  +        See side menu for choices.
  +        """)
  +        
           overviewSection=document.createSection('Overview')
           overviewList=overviewSection.createList()
           overviewList.createEntry('Modules: ', stats.wguru.modulesInWorkspace)
  @@ -1409,10 +1414,15 @@
           self.documentModulesByDependencies(stats, run, workspace, gumpSet)
           self.documentModulesByDependees(stats, run, workspace, gumpSet)
           self.documentModulesByFOGFactor(stats, run, workspace, gumpSet)        
  +        # Individual Pages...
  +        self.documentProjectsByElapsed(stats, run, workspace, gumpSet)
  +        self.documentProjectsByDependencies(stats, run, workspace, gumpSet)
  +        self.documentProjectsByDependees(stats, run, workspace, gumpSet)
  +        self.documentProjectsByFOGFactor(stats, run, workspace, gumpSet)        
       
       def documentModulesByElapsed(self,stats,run,workspace,gumpSet):
           document=XDocDocument('Modules By Elapsed Time',	\
  -            self.resolver.getFile(stats,'elapsed.xml'))
  +            self.resolver.getFile(stats,'module_elapsed.xml'))
           
           elapsedTable=document.createTable(['Modules By Elapsed'])
           for module in stats.modulesByElapsed:        
  @@ -1425,7 +1435,7 @@
       
       def documentModulesByProjects(self,stats,run,workspace,gumpSet):
           document=XDocDocument('Modules By Project Count',	\
  -            self.resolver.getFile(stats,'projects.xml'))
  +            self.resolver.getFile(stats,'module_projects.xml'))
           
           mprojsTable=document.createTable(['Modules By Project Count'])
           for module in stats.modulesByProjectCount:         
  @@ -1448,14 +1458,14 @@
        
       def documentModulesByDependencies(self,stats,run,workspace,gumpSet):
           document=XDocDocument('Modules By Dependency Count',	\
  -            self.resolver.getFile(stats,'dependencies.xml'))
  +            self.resolver.getFile(stats,'module_dependencies.xml'))
           
           dependenciesTable=document.createTable(['Modules By Dependency Count'])
           for module in stats.modulesByTotalDependencies:         
               if not gumpSet.inModules(module): continue   
               dependenciesRow=dependenciesTable.createRow()
               self.insertLink( module, stats, dependenciesRow.createData())
  -            dependenciesRow.createData( module.dependencyCount())
  +            dependenciesRow.createData( module.getDependencyCount())
               
               #projectsString=''
               #for project in module.getDepends():
  @@ -1468,14 +1478,14 @@
        
       def documentModulesByDependees(self,stats,run,workspace,gumpSet):
           document=XDocDocument('Modules By Dependee Count',
  -                    self.resolver.getFile(stats,'dependees.xml'))
  +                    self.resolver.getFile(stats,'module_dependees.xml'))
           
           dependeesTable=document.createTable(['Modules By Dependee Count'])
           for module in stats.modulesByTotalDependees:         
               if not gumpSet.inModules(module): continue   
               dependeesRow=dependeesTable.createRow()
               self.insertLink( module, stats, dependeesRow.createData())
  -            dependeesRow.createData(module.dependeeCount())
  +            dependeesRow.createData(module.getDependeeCount())
               
               #projectsString=''
               #for project in module.getDependees():
  @@ -1487,23 +1497,87 @@
           
       def documentModulesByFOGFactor(self,stats,run,workspace,gumpSet):
           document=XDocDocument('Modules By FOG Factor',	\
  -                    self.resolver.getFile(stats,'fogfactor.xml'),)        
  -        fogTable=document.createTable(['Modules By FOG Factor'])
  +                    self.resolver.getFile(stats,'module_fogfactor.xml'),)        
  +        fogTable=document.createTable(['Module','FOG Factor'])
           for module in stats.modulesByFOGFactor:        
               if not gumpSet.inModules(module): continue    
               fogRow=fogTable.createRow()            
               self.insertLink( module, stats, fogRow.createData())                
               fogRow.createData(round(module.getFOGFactor(),2))
               
  +        document.serialize()
  +    
  +    def documentProjectsByElapsed(self,stats,run,workspace,gumpSet):
  +        document=XDocDocument('Projects By Elapsed Time',	\
  +            self.resolver.getFile(stats,'project_elapsed.xml'))
  +        
  +        elapsedTable=document.createTable(['Projects By Elapsed'])
  +        for project in stats.projectsByElapsed:        
  +            if not gumpSet.inSequence(project): continue
  +            elapsedRow=elapsedTable.createRow()
  +            self.insertLink( project, stats, elapsedRow.createData())
  +            elapsedRow.createData(secsToElapsedString(project.getElapsedSecs()))
  +            
  +        document.serialize()
  +     
  +    def documentProjectsByDependencies(self,stats,run,workspace,gumpSet):
  +        document=XDocDocument('Projects By Dependency Count',	\
  +            self.resolver.getFile(stats,'project_dependencies.xml'))
  +        
  +        dependenciesTable=document.createTable(['Projects By Dependency Count'])
  +        for project in stats.projectsByTotalDependencies:         
  +            if not gumpSet.inSequence(project): continue   
  +            dependenciesRow=dependenciesTable.createRow()
  +            self.insertLink( project, stats, dependenciesRow.createData())
  +            dependenciesRow.createData( project.getDependencyCount())
  +            
  +            #projectsString=''
  +            #for project in module.getDepends():
  +            #    projectsString+=getContextLink(project)
  +            #    projectsString+=' '            
  +            #dependenciesRow.createData(projectsString)        
  +        
  +        document.serialize()
  +             
  +     
  +    def documentProjectsByDependees(self,stats,run,workspace,gumpSet):
  +        document=XDocDocument('Projects By Dependee Count',
  +                    self.resolver.getFile(stats,'project_dependees.xml'))
  +        
  +        dependeesTable=document.createTable(['Projects By Dependee Count'])
  +        for project in stats.projectsByTotalDependees:         
  +            if not gumpSet.inSequence(project): continue   
  +            dependeesRow=dependeesTable.createRow()
  +            self.insertLink( project, stats, dependeesRow.createData())
  +            dependeesRow.createData(project.getDependeeCount())
  +            
               #projectsString=''
  -            #for project in module:
  +            #for project in module.getDependees():
               #    projectsString+=getContextLink(project)
  -            #    projectsString+='='            
  -            #    projectsString+=str(round(project.getFOGFactor(),2))
  -            #    projectsString+='  '            
  -            #fogRow.createData(projectsString)
  +            #    projectsString+=' '            
  +            #dependeesRow.createData(projectsString)
  +        
  +        document.serialize()
  +        
  +    def documentProjectsByFOGFactor(self,stats,run,workspace,gumpSet):
  +        document=XDocDocument('Projects By FOG Factor',	\
  +                    self.resolver.getFile(stats,'project_fogfactor.xml'),)        
  +        fogTable=document.createTable(['Project','Successes','Failures','Preq-Failures','FOG
Factor'])
  +        for project in stats.projectsByFOGFactor:        
  +            if not gumpSet.inSequence(project): continue    
  +            fogRow=fogTable.createRow()            
  +            self.insertLink( project, stats, fogRow.createData())  
  +                 
  +            pstats=project.getStats()
  +            
  +            fogRow.createData(pstats.successes)
  +            fogRow.createData(pstats.failures)
  +            fogRow.createData(pstats.prereqs)
  +            fogRow.createData(round(pstats.getFOGFactor(),2))
               
           document.serialize()
  +   
  +
           
       #####################################################################           
       #
  @@ -1515,8 +1589,10 @@
           
           document=XDocDocument('Cross Reference',self.resolver.getFile(xref))
       
  -        # :TODO: Packages and such...
  -        document.createParagraph('To be completed...')
  +        document.createParagraph("""
  +        Relationships are what Gump is about, this section shows relationship. 
  +        See side menu for choices.
  +        """)
       
           document.serialize()
           
  @@ -1533,7 +1609,8 @@
           for repo in createOrderedList(repoMap.keys()):
               moduleList=createOrderedList(repoMap.get(repo))            
               repoSection=document.createSection(repo.getName())            
  -            self.insertLink( repo, xref, repoSection.createParagraph('Repository Definition:
'))
  +            self.insertLink( repo, xref, 	\
  +                repoSection.createParagraph('Repository Definition: '))
               
               moduleRepoTable=repoSection.createTable(['Modules'])
               for module in moduleList:        
  @@ -1550,7 +1627,7 @@
           packageTable=document.createTable(['Modules By Package'])
           
           packageMap=xref.getPackageToModuleMap()
  -        for package in packageMap.keys():
  +        for package in createOrderedList(packageMap.keys()):
               
               moduleList=createOrderedList(packageMap.get(package)) 
               
  
  
  

Mime
View raw message