Changeset 52404 in webkit
- Timestamp:
- Dec 20, 2009 12:27:50 AM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r52400 r52404 1 2009-12-20 Adam Barth <abarth@webkit.org> 2 3 Reviewed by Eric Seidel. 4 5 Use memcache to make dashboard to fast 6 https://bugs.webkit.org/show_bug.cgi?id=32780 7 8 * QueueStatusServer/app.yaml: 9 * QueueStatusServer/handlers/dashboard.py: 10 * QueueStatusServer/handlers/updatestatus.py: 11 * QueueStatusServer/model/attachment.py: Added. 12 1 13 2009-12-19 Brent Fulgham <bfulgham@webkit.org> 2 14 -
trunk/WebKitTools/QueueStatusServer/app.yaml
r52381 r52404 8 8 static_dir: stylesheets 9 9 10 - url: /remote_api 11 script: $PYTHON_LIB/google/appengine/ext/remote_api/handler.py 12 login: admin 13 10 14 - url: /.* 11 15 script: main.py -
trunk/WebKitTools/QueueStatusServer/handlers/dashboard.py
r52396 r52404 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import re30 31 29 from google.appengine.ext import webapp 32 30 from google.appengine.ext.webapp import template 33 31 34 from model.queuestatus import QueueStatus 35 from handlers.statusbubble import StatusSummary 36 37 queues = [ 38 "style-queue", 39 "chromium-ews", 40 "qt-ews", 41 "gtk-ews", 42 ] 43 44 def dash_to_underscore(dashed_name): 45 regexp = re.compile("-") 46 return regexp.sub("_", dashed_name) 47 48 def state_from_status(status): 49 table = { 50 "Pass" : "pass", 51 "Fail" : "fail", 52 } 53 return table.get(status.message, "none") 54 55 def summarize(attachment_id): 56 summary = { "attachment_id" : attachment_id } 57 58 # FIXME: We shouldn't have to make another query to figure this out. 59 # We'll fix this with memcache. Notice that we can't grab it 60 # below because the patch might not have been processed by one 61 # these queues yet. 62 summary["bug_id"] = QueueStatus.all().filter('active_patch_id =', attachment_id).fetch(1)[0].active_bug_id 63 64 for queue in queues: 65 summary[queue] = None 66 status = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', attachment_id).order('-date').get() 67 if status: 68 summary[dash_to_underscore(queue)] = { 69 "state" : state_from_status(status), 70 "status" : status, 71 } 72 return summary 73 32 from model.attachment import Attachment 74 33 75 34 class Dashboard(webapp.RequestHandler): 76 35 def get(self): 77 status_summary = StatusSummary() 78 statuses = QueueStatus.all().order("-date") 79 80 attachment_ids = set() 81 for status in statuses: 82 if not status.active_patch_id: 83 continue 84 attachment_ids.add(status.active_patch_id) 85 if len(attachment_ids) >= 25: 86 break 36 attachments = Attachment.recent(limit=25) 87 37 88 38 template_values = { 89 "summaries" : map(summarize, sorted(attachment_ids)),39 "summaries" : [attachment.summary() for attachment in attachments], 90 40 } 91 41 self.response.out.write(template.render("templates/dashboard.html", template_values)) -
trunk/WebKitTools/QueueStatusServer/handlers/updatestatus.py
r52396 r52404 31 31 from google.appengine.ext.webapp import template 32 32 33 from model.attachment import Attachment 33 34 from model.queuestatus import QueueStatus 34 35 … … 53 54 queue_status.author = users.get_current_user() 54 55 55 queue_name = self.request.get('queue_name') 56 bug_id = self._int_from_request("bug_id") 57 patch_id = self._int_from_request("patch_id") 58 queue_name = self.request.get("queue_name") 56 59 queue_status.queue_name = queue_name 57 queue_status.active_bug_id = self._int_from_request('bug_id')58 queue_status.active_patch_id = self._int_from_request('patch_id')59 queue_status.message = self.request.get( 'status')60 queue_status.active_bug_id = bug_id 61 queue_status.active_patch_id = patch_id 62 queue_status.message = self.request.get("status") 60 63 results_file = self.request.get("results_file") 61 64 queue_status.results_file = db.Blob(str(results_file)) 62 65 queue_status.put() 66 Attachment.dirty(patch_id) 63 67 self.response.out.write(queue_status.key().id())
Note: See TracChangeset
for help on using the changeset viewer.