couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [14/19] git commit: Connect directly to node-inspector for now
Date Mon, 11 Feb 2013 13:51:16 GMT
Connect directly to node-inspector for now


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/45654f11
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/45654f11
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/45654f11

Branch: refs/heads/nodejs_couchdb
Commit: 45654f115ef1a1f7c1accaabf73222818032d6d6
Parents: df3cf5e
Author: Jason Smith (work) <jhs@iriscouch.com>
Authored: Fri Feb 8 10:01:55 2013 +0000
Committer: Jason Smith (work) <jhs@iriscouch.com>
Committed: Fri Feb 8 10:01:55 2013 +0000

----------------------------------------------------------------------
 share/www/debug.html              |   13 ++++++++-----
 src/couchdb/couch_httpd_debug.erl |    2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/45654f11/share/www/debug.html
----------------------------------------------------------------------
diff --git a/share/www/debug.html b/share/www/debug.html
index 5738cb4..7aee22a 100644
--- a/share/www/debug.html
+++ b/share/www/debug.html
@@ -92,21 +92,24 @@ function get_debuggers() {
       return
 
     res.body.pids.forEach(function(pid) {
-      var link = $('<li><a href="#">' + pid + '</a></li>')
+      var port = res.body.procs[pid] + 1
+      var url = 'http://' + window.location.hostname + ':' + port + '/_debug/' + pid + '/'
+      var link = $('<li><a href="'+url+'">' + pid + '</a></li>')
+      console.log(res.body)
       servers.append(link)
 
       link.find('a').click(function() {
-        inspect_pid(pid)
+        var url = $(this).attr('href')
+        inspect_pid(pid, url)
         return false
       })
     })
   })
 }
 
-function inspect_pid(pid) {
-  var src = '/_debug/' + pid + '/'
+function inspect_pid(pid, url) {
   $('#node_inspector .title').html('Debugging: <' + pid + '>')
-  $('#node_inspector_frame').attr('src', src)
+  $('#node_inspector_frame').attr('src', url)
   $('#node_inspector_frame').css('border', '1px solid black')
 }
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/45654f11/src/couchdb/couch_httpd_debug.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_debug.erl b/src/couchdb/couch_httpd_debug.erl
index 6faf966..9ca0eab 100644
--- a/src/couchdb/couch_httpd_debug.erl
+++ b/src/couchdb/couch_httpd_debug.erl
@@ -22,7 +22,7 @@ handle_debug_req(#httpd{method='GET', path_parts=[_Debug]}=Req) -> ok
     , ok = couch_httpd:verify_is_server_admin(Req)
     , Procs = couch_query_servers:debug_ports("javascript")
     , Pids = [ Pid || {Pid, _Port} <- Procs ]
-    , couch_httpd:send_json(Req, 200, {[ {ok,true}, {pids, Pids} ]})
+    , couch_httpd:send_json(Req, 200, {[ {ok,true}, {pids,Pids}, {procs,{Procs}} ]})
     ;
 
 handle_debug_req(#httpd{method='GET', path_parts=[_Debug, Pid | _Rest]=Path}=Req) -> ok


Mime
View raw message