You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2013/12/20 20:17:28 UTC

[1/3] git commit: [#6388] wrapper script to run call_counts.py for a range of git commits

Updated Branches:
  refs/heads/db/6388 8474a348d -> ce1ea885b


[#6388] wrapper script to run call_counts.py for a range of git commits


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

Branch: refs/heads/db/6388
Commit: 95f0b1dc37d92eb2713aa78562a91c0ca26962c5
Parents: 8474a34
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Dec 20 19:02:51 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Dec 20 19:02:51 2013 +0000

----------------------------------------------------------------------
 scripts/perf/call_count_walk_git.sh | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/95f0b1dc/scripts/perf/call_count_walk_git.sh
----------------------------------------------------------------------
diff --git a/scripts/perf/call_count_walk_git.sh b/scripts/perf/call_count_walk_git.sh
new file mode 100755
index 0000000..8bb41ba
--- /dev/null
+++ b/scripts/perf/call_count_walk_git.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+if [[ $@ ]]
+then
+    revs=$@
+else
+    revs='HEAD -n 10'
+    echo "No git revision range given, using $revs"
+    echo "Other range formats like bdde98d..HEAD work too"
+    echo
+fi
+
+current=`git rev-parse --abbrev-ref HEAD`
+git rev-list --reverse $revs --oneline | while read commit
+do
+    echo $commit
+    sha=${commit:0:7}
+    git checkout -q $sha || { echo "Could not check out $sha, stopping.  You started on $current"; break; }
+    ./call_count.py --id "$commit"
+done
+git checkout -q $current
\ No newline at end of file


[2/3] git commit: [#6388] avoid empty trove queries

Posted by br...@apache.org.
[#6388] avoid empty trove queries


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

Branch: refs/heads/db/6388
Commit: 62d57d2f8dd646d4fb2f1ee00b4f25173349a57b
Parents: 95f0b1d
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Dec 20 19:03:12 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Dec 20 19:03:12 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/project.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/62d57d2f/Allura/allura/model/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index d8584ef..b720343 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -257,7 +257,11 @@ class Project(MappedClass, ActivityNode, ActivityObject):
         return result
 
     def troves_by_type(self, trove_type):
-        return TroveCategory.query.find({'_id':{'$in':getattr(self,'trove_%s' % trove_type)}}).all()
+        troves = getattr(self, 'trove_%s' % trove_type)
+        if troves:
+            return TroveCategory.query.find({'_id':{'$in': troves}}).all()
+        else:
+            return []
 
     def all_troves(self):
         '''


[3/3] git commit: [#6388] more help text

Posted by br...@apache.org.
[#6388] more help text


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

Branch: refs/heads/db/6388
Commit: ce1ea885b25bd20c574ea5e1c0e35c16afe7a818
Parents: 62d57d2
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Fri Dec 20 19:14:16 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Fri Dec 20 19:16:31 2013 +0000

----------------------------------------------------------------------
 scripts/perf/call_count.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ce1ea885/scripts/perf/call_count.py
----------------------------------------------------------------------
diff --git a/scripts/perf/call_count.py b/scripts/perf/call_count.py
index 0c93705..f965294 100755
--- a/scripts/perf/call_count.py
+++ b/scripts/perf/call_count.py
@@ -39,10 +39,14 @@ from forgewiki import model as WM
 
 
 def parse_args():
-    parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
-                                     description='Count number of expensive calls (mongo, markdown, etc) for a standard page.')
+    parser = argparse.ArgumentParser(
+        formatter_class=argparse.RawTextHelpFormatter,
+        description='Count number of expensive calls (mongo, markdown, etc) for a standard page.\n'
+                    'Currently its a _discuss URL with a few posts on it.  This exercises core logic\n'
+                    '(project & tool lookup, security, discussion thread, main template, etc) but\n'
+                    'intentionally avoids most tool-specific code.')
     parser.add_argument('--verbose', '-v', action='store_true', default=False,
-                        help='Show call details')
+                        help='Show call details.  Note that Timers with debug_each_call=False (like ming\'s Cursor.next) are not displayed in verbose mode (but they are counted).')
     parser.add_argument('--debug-html', action='store_true', default=False,
                         help='Save HTML responses as local files')
     parser.add_argument('--data-file', default='call_counts.csv', type=argparse.FileType('a'),