allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/4] git commit: [#4691] Slight bump to cache size and some cleanup on reporting for refresh-last-commits.py
Date Tue, 11 Dec 2012 21:14:28 GMT
Updated Branches:
  refs/heads/cj/4691 4ea4e88c9 -> e69cb2fd1


[#4691] Slight bump to cache size and some cleanup on reporting for refresh-last-commits.py

Signed-off-by: Cory Johns <johnsca@geek.net>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/e69cb2fd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/e69cb2fd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/e69cb2fd

Branch: refs/heads/cj/4691
Commit: e69cb2fd1381f3af93d5e02b9957b6ab3a19df16
Parents: 7b5bc94
Author: Cory Johns <johnsca@geek.net>
Authored: Tue Dec 11 21:14:07 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Tue Dec 11 21:14:07 2012 +0000

----------------------------------------------------------------------
 scripts/refresh-last-commits.py |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/e69cb2fd/scripts/refresh-last-commits.py
----------------------------------------------------------------------
diff --git a/scripts/refresh-last-commits.py b/scripts/refresh-last-commits.py
index e027d7c..531fa83 100644
--- a/scripts/refresh-last-commits.py
+++ b/scripts/refresh-last-commits.py
@@ -98,7 +98,7 @@ def refresh_repo_lcds(commit_ids, options):
                 at = tt / len(timings)
                 print '  Processed %d commits (max: %f, avg: %f, tot: %f, cl: %d)' % (
                         len(timings), mt, at, tt, len(tree_cache))
-    lcd_cache = M.repo.ModelCache(6000)
+    lcd_cache = M.repo.ModelCache(8000)
     timings = []
     print 'Processing last commits'
     debug_step = int(pow(10, max(0, int(log10(len(commit_ids)) - log10(options.step) - 1))))
@@ -120,15 +120,22 @@ def refresh_repo_lcds(commit_ids, options):
             mat = sum(timings[-debug_step:]) / debug_step
             lhits = lcd_cache._hits[M.repo.LastCommit]
             laccs = lcd_cache._accesses[M.repo.LastCommit]
+            lavg = lhits * 100 / laccs if laccs > 0 else 0
             ohits = sum([v for k,v in lcd_cache._hits.items() if k != M.repo.LastCommit])
             oaccs = sum([v for k,v in lcd_cache._accesses.items() if k != M.repo.LastCommit])
+            oavg = ohits * 100 / oaccs if oaccs > 0 else 0
+            gavg = lcd_cache._get_walks / lcd_cache._get_calls if lcd_cache._get_calls >
0 else 0
+            gper = lcd_cache._get_hits * 100 / lcd_cache._get_calls if lcd_cache._get_calls
> 0 else 0
+            bavg = lcd_cache._build_walks / lcd_cache._build_calls if lcd_cache._build_calls
> 0 else 0
             print '  Processed %d commits (max: %f, avg: %f, mavg: %f, tot: %f, lc: %d/%d,
hit: %d/%d, agw: %d, mgw: %d, gh: %d, abw: %d, mbw: %d, ts: %d)' % (
                     len(timings), mt, at, mat, tt,
                     lcd_cache.size(), len(lcd_cache._cache[M.repo.LastCommit]),
-                    ohits * 100 / oaccs, lhits * 100 / laccs,
-                    lcd_cache._get_walks / lcd_cache._get_calls, lcd_cache._get_walks_max,
lcd_cache._get_hits * 100 / lcd_cache._get_calls,
-                    lcd_cache._build_walks / lcd_cache._build_calls, lcd_cache._build_walks_max,
+                    oavg, lavg,
+                    gavg, lcd_cache._get_walks_max, gper,
+                    bavg, lcd_cache._build_walks_max,
                     len(lcd_cache.get(M.repo.TreesDoc, dict(_id=commit._id)).tree_ids))
+            lcd_cache._get_walks_max = 0
+            lcd_cache._build_walks_max = 0
             ThreadLocalORMSession.flush_all()
             ThreadLocalORMSession.close_all()
     ThreadLocalORMSession.flush_all()


Mime
View raw message