You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@allura.apache.org by Mykola Kharechko <kh...@users.sf.net> on 2014/01/03 12:49:36 UTC
[allura:tickets] #6905 better code snapshot status UX
I am new to allura. Will next request be efficient enought?
MonQTask.query.find({'task_name': 'allura.tasks.repo_tasks.tarball', '$or': [{'kwargs': {u'path': u'', u'revision': u'790b7439e8c598ae1029a817c93cd5406584a746'}}, {'args':['790b7439e8c598ae1029a817c93cd5406584a746', '']}]}).sort([('time_queue', pymongo.DESCENDING),]).limit(1).first()
It don't use objectid timestamp, but simplify code.
---
** [tickets:#6905] better code snapshot status UX**
**Status:** in-progress
**Labels:** 42cc ux
**Created:** Wed Nov 20, 2013 09:44 PM UTC by Dave Brondsema
**Last Updated:** Tue Dec 03, 2013 12:23 AM UTC
**Owner:** nobody
The current snapshot behavior doesn't really tell the user what's going on. After you request a snapshot, it says its looking for one and then just waits for a while until either the snapshot is ready or it suggests that you re-submit. The system should be able to check to see if there is a background task running or not. If it is actively running, we should say that. And not prompt to re-submit.
Make sure any monq_task queries will be efficient, by using existing indexes. Constructing an ObjectId from timestamp and querying on _id to just look for recent tasks may be helpful.
---
Sent from sourceforge.net because allura-dev@incubator.apache.org is subscribed to https://sourceforge.net/p/allura/tickets/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/allura/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
[allura:tickets] Re: #6905 better code snapshot status UX
Posted by Dave Brondsema <br...@users.sf.net>.
If you can add 'status' to that query, then it would be. But without it, it will not use any index:
~~~~
> db.monq_task.find({'task_name': 'allura.tasks.repo_tasks.tarball', '$or': [{'kwargs': {'path': '', 'revision': '790b7439e8c598ae1029a817c93cd5406584a746'}}, {'args':['790b7439e8c598ae1029a817c93cd5406584a746', '']}]}).explain()
{
"cursor" : "BasicCursor",
...
"nscanned" : 42350,
...
> db.monq_task.find({'state': 'busy', 'task_name': 'allura.tasks.repo_tasks.tarball', '$or': [{'kwargs': {'path': '', 'revision': '790b7439e8c598ae1029a817c93cd5406584a746'}}, {'args':['790b7439e8c598ae1029a817c93cd5406584a746', '']}]}).explain()
{
"cursor" : "BtreeCursor state_1_task_name_1_time_queue_1",
...
"nscanned" : 0,
...
~~~~
`BasicCursor` means no index is used, `BtreeCursor` means an index is being used. See http://docs.mongodb.org/manual/core/index-compound/ for more info on mongo indexes (including the Prefixes section at bottom). To see what indexes are specified for a model/collection, look at the `indexes` var within the `__mongometa__` section of our python class. And there is always an index on `_id`
---
** [tickets:#6905] better code snapshot status UX**
**Status:** in-progress
**Labels:** 42cc ux
**Created:** Wed Nov 20, 2013 09:44 PM UTC by Dave Brondsema
**Last Updated:** Fri Jan 03, 2014 11:49 AM UTC
**Owner:** nobody
The current snapshot behavior doesn't really tell the user what's going on. After you request a snapshot, it says its looking for one and then just waits for a while until either the snapshot is ready or it suggests that you re-submit. The system should be able to check to see if there is a background task running or not. If it is actively running, we should say that. And not prompt to re-submit.
Make sure any monq_task queries will be efficient, by using existing indexes. Constructing an ObjectId from timestamp and querying on _id to just look for recent tasks may be helpful.
---
Sent from sourceforge.net because allura-dev@incubator.apache.org is subscribed to https://sourceforge.net/p/allura/tickets/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/allura/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.