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 2018/02/27 23:15:34 UTC
[1/3] allura git commit: [#8189] Config update for profiling
Repository: allura
Updated Branches:
refs/heads/master 14d4fe1c9 -> 880090cf2
[#8189] Config update for profiling
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/8cae286d
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/8cae286d
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/8cae286d
Branch: refs/heads/master
Commit: 8cae286d8b65a9ac1f71e9eb235d8ad0ad0ee177
Parents: 17c1064
Author: Kenton Taylor <kt...@slashdotmedia.com>
Authored: Mon Feb 26 09:31:12 2018 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Feb 27 18:02:50 2018 -0500
----------------------------------------------------------------------
Allura/docker-dev.ini | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/8cae286d/Allura/docker-dev.ini
----------------------------------------------------------------------
diff --git a/Allura/docker-dev.ini b/Allura/docker-dev.ini
index ee7734f..3f008b4 100644
--- a/Allura/docker-dev.ini
+++ b/Allura/docker-dev.ini
@@ -20,9 +20,19 @@ use = egg:Paste#http
host = 0.0.0.0
port = 8088
+# profile for profiling. use in conjunction with filter-with below.
+;[filter:profile]
+;use = egg:repoze.profile#profile
+;log_filename = /allura/allura.profile
+;cachegrind_filename = /allura-data/cachegrind.out.allura
+;discard_first_request = true
+;path = /__alluraprofile__
+;flush_at_shutdown = true
+
+
[app:main]
use = config:development.ini#main
-
+;filter-with = profile
activitystream.master = mongodb://mongo:27017
ming.main.uri = mongodb://mongo:27017/allura
@@ -54,9 +64,6 @@ smtp_port = 8826
forgemail.host = 0.0.0.0
forgemail.port = 8825
-[filter-app:profile]
-use=egg:keas.profile#profiler
-next=main
[app:task]
use = main
[3/3] allura git commit: [#8189] Adds testing util script to populate
lots of forum topics
Posted by br...@apache.org.
[#8189] Adds testing util script to populate lots of forum topics
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/880090cf
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/880090cf
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/880090cf
Branch: refs/heads/master
Commit: 880090cf28bdf7cc7a775c1a08582bab4821d8d0
Parents: 8cae286
Author: Kenton Taylor <kt...@slashdotmedia.com>
Authored: Tue Feb 27 16:16:27 2018 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Feb 27 18:03:13 2018 -0500
----------------------------------------------------------------------
Allura/allura/lib/widgets/discuss.py | 3 ++
scripts/perf/load-up-forum.py | 74 +++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/880090cf/Allura/allura/lib/widgets/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/discuss.py b/Allura/allura/lib/widgets/discuss.py
index 0a7e8b9..7afdac4 100644
--- a/Allura/allura/lib/widgets/discuss.py
+++ b/Allura/allura/lib/widgets/discuss.py
@@ -221,6 +221,9 @@ class SubscriptionForm(ew.SimpleForm):
class fields(ew_core.NameList):
page_list = ffw.PageList()
page_size = ffw.PageSize()
+
+ # Careful! using the same name as the prop on the model will invoke the RelationalProperty,
+ # causing all related entities to be (re)fetched.
_threads = _ThreadsTable()
def resources(self):
http://git-wip-us.apache.org/repos/asf/allura/blob/880090cf/scripts/perf/load-up-forum.py
----------------------------------------------------------------------
diff --git a/scripts/perf/load-up-forum.py b/scripts/perf/load-up-forum.py
new file mode 100644
index 0000000..2184411
--- /dev/null
+++ b/scripts/perf/load-up-forum.py
@@ -0,0 +1,74 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+
+import logging
+import uuid
+from ming.orm import ThreadLocalORMSession, session
+from pylons import tmpl_context as c
+from allura import model as M
+from forgediscussion.model import ForumPost, Forum
+from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter, ArgumentTypeError
+from allura.lib import helpers as h
+from random import randint
+
+
+log = logging.getLogger(__name__)
+
+
+def arguments():
+ parser = ArgumentParser(description="Args for changing anon comment permissions",
+ formatter_class=ArgumentDefaultsHelpFormatter, )
+ parser.add_argument('shortname', help="shortname of project to change ")
+ parser.add_argument('mountpt', help="toolname ")
+ parser.add_argument('forumname', help="forum")
+
+ args = parser.parse_args()
+ return args
+
+
+def main():
+ args = arguments()
+
+ c.user = M.User.query.get(username='root')
+
+ with h.push_context(args.shortname, args.mountpt, neighborhood='Projects'):
+
+ tool = c.project.app_config_by_tool_type(args.mountpt)
+
+ # create tons of topics
+ discussion = Forum.query.get(
+ app_config_id=tool._id,
+ shortname=args.forumname)
+
+ for i in range(5000):
+ subject = 'fake topic {}'.format(str(i))
+ thd = discussion.thread_class()(discussion_id=discussion._id, subject=subject)
+ # subj = str(uuid.uuid4())[:8]
+ p = thd.post(subject, 'a new topic 2')
+
+ for j in range(randint(1, 5)):
+ new_post = {'text':'comment text'}
+ # post = thd.add_post(**new_post)
+ post = thd.add_post(text='comment text for real', subject="test subject")
+
+ if i % 1000:
+ session(p).flush()
+
+
+if __name__ == '__main__':
+ main()
[2/3] allura git commit: [#8189] Fix poor perf on forum listings page,
due to unintended trip of ming RelationProperty
Posted by br...@apache.org.
[#8189] Fix poor perf on forum listings page, due to unintended trip of ming RelationProperty
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/17c10642
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/17c10642
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/17c10642
Branch: refs/heads/master
Commit: 17c1064267eec1dbf1055d3857b173c3d5b4696e
Parents: 14d4fe1
Author: Kenton Taylor <kt...@slashdotmedia.com>
Authored: Mon Feb 26 09:30:33 2018 -0500
Committer: Dave Brondsema <da...@brondsema.net>
Committed: Tue Feb 27 18:02:50 2018 -0500
----------------------------------------------------------------------
Allura/allura/lib/widgets/discuss.py | 2 +-
Allura/allura/templates/widgets/subscription_form.html | 2 +-
ForgeDiscussion/forgediscussion/widgets/forum_widgets.py | 4 +++-
docker-compose.yml | 1 +
4 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/17c10642/Allura/allura/lib/widgets/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/widgets/discuss.py b/Allura/allura/lib/widgets/discuss.py
index 76035d7..0a7e8b9 100644
--- a/Allura/allura/lib/widgets/discuss.py
+++ b/Allura/allura/lib/widgets/discuss.py
@@ -221,7 +221,7 @@ class SubscriptionForm(ew.SimpleForm):
class fields(ew_core.NameList):
page_list = ffw.PageList()
page_size = ffw.PageSize()
- threads = _ThreadsTable()
+ _threads = _ThreadsTable()
def resources(self):
for r in super(SubscriptionForm, self).resources():
http://git-wip-us.apache.org/repos/asf/allura/blob/17c10642/Allura/allura/templates/widgets/subscription_form.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/widgets/subscription_form.html b/Allura/allura/templates/widgets/subscription_form.html
index c03f8d2..f86e3b3 100644
--- a/Allura/allura/templates/widgets/subscription_form.html
+++ b/Allura/allura/templates/widgets/subscription_form.html
@@ -24,7 +24,7 @@
<div class="pagination_size">{{ pager_widget_output }}</div>
{% endif %}
<form method="{{method}}" action="{{action}}" {% if enctype %}enctype="{{enctype}}"{% endif %} class="follow_form">
- {{widget.fields['threads'].display(value=threads)}}
+ {{widget.fields['_threads'].display(value=threads)}}
{% if threads and not c.user.is_anonymous() and
not c.subscribed and not c.tool_subscribed %}
<p>
http://git-wip-us.apache.org/repos/asf/allura/blob/17c10642/ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/widgets/forum_widgets.py b/ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
index 7eb0fc5..3dbe2c7 100644
--- a/ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
+++ b/ForgeDiscussion/forgediscussion/widgets/forum_widgets.py
@@ -48,7 +48,9 @@ class _ThreadsTable(DW._ThreadsTable):
class ThreadSubscriptionForm(DW.SubscriptionForm):
class fields(ew_core.NameList):
- threads = _ThreadsTable()
+ # Careful! using the same name as the prop on the model will invoke the RelationalProperty,
+ # causing all related entities to be (re)fetched.
+ _threads = _ThreadsTable()
page_list = ffw.PageList()
page_size = ffw.PageSize()
http://git-wip-us.apache.org/repos/asf/allura/blob/17c10642/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index b91a0a0..9741b93 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -27,6 +27,7 @@ services:
volumes: &volumes
- .:/allura # Allura source code from local host
- /allura-data:/allura-data # for virtualenv, scm repos, etc
+ - /allura-data/root/home:/root # for persistent home dir, mainly for pudb
links:
- mongo
- solr