summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Smith (work) <jhs@iriscouch.com>2013-02-08 10:01:55 +0000
committerJason Smith (work) <jhs@iriscouch.com>2013-02-08 10:01:55 +0000
commit45654f115ef1a1f7c1accaabf73222818032d6d6 (patch)
tree9070a4213fde582194880b1636e8c598e6a1311c
parentdf3cf5e2638cf01c2cd0fc9eeb04dc3e53dd1830 (diff)
downloadcouchdb-45654f115ef1a1f7c1accaabf73222818032d6d6.tar.gz
Connect directly to node-inspector for now
-rw-r--r--share/www/debug.html13
-rw-r--r--src/couchdb/couch_httpd_debug.erl2
2 files changed, 9 insertions, 6 deletions
diff --git a/share/www/debug.html b/share/www/debug.html
index 5738cb405..7aee22a39 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')
}
diff --git a/src/couchdb/couch_httpd_debug.erl b/src/couchdb/couch_httpd_debug.erl
index 6faf96643..9ca0eab8b 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