##// END OF EJS Templates
tests: move vcs_operations into its own module.
tests: move vcs_operations into its own module.

File last commit:

r2304:2ea4335b default
r2456:db312489 default
Show More
settings_process_management.mako
141 lines | 4.5 KiB | application/x-mako | MakoHtmlLexer
/ rhodecode / templates / admin / settings / settings_process_management.mako
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885
<div id="update_notice" style="display: none; margin: -40px 0px 20px 0px">
<div>${_('Checking for updates...')}</div>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">${_('Gunicorn process management')}</h3>
</div>
<div class="panel-body" id="app">
<h3>List of Gunicorn processes on this machine</h3>
processes: use better naming detection of running processes
r2165 <%
processes: use better naming detection of running children processes
r2166 def get_name(proc):
cmd = ' '.join(proc.cmdline())
processes: use better naming detection of running processes
r2165 if 'vcsserver.ini' in cmd:
return 'VCSServer'
elif 'rhodecode.ini' in cmd:
return 'RhodeCode'
return proc.name()
%>
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885 <table>
% for proc in c.gunicorn_processes:
<% mem = proc.memory_info()%>
process-management: structure the process by master.
r1887 <% children = proc.children(recursive=True) %>
% if children:
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885
<tr>
<td>
<code>
processes: use better naming detection of running children processes
r2166 ${proc.pid} - ${get_name(proc)}
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885 </code>
</td>
<td>
process-management: show helper for CMDLINE.
r1886 <a href="#showCommand" onclick="$('#pid'+${proc.pid}).toggle();return false"> command </a>
<code id="pid${proc.pid}" style="display: none">
processes: use better naming detection of running children processes
r2166 ${' '.join(proc.cmdline())}
process-management: show helper for CMDLINE.
r1886 </code>
</td>
process-management: show CPU numbers for processes.
r1888 <td></td>
process-management: show helper for CMDLINE.
r1886 <td>
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885 RSS:${h.format_byte_size_binary(mem.rss)}
</td>
<td>
VMS:${h.format_byte_size_binary(mem.vms)}
</td>
<td>
processes: show age of processes.
r2304 AGE: ${h.age_component(h.time_to_utcdatetime(proc.create_time()))}
</td>
<td>
process-management: show sum of RSS memory for whole process tree.
r1901 MASTER
process-management: structure the process by master.
r1887 </td>
</tr>
process-management: show sum of RSS memory for whole process tree.
r1901 <% mem_sum = 0 %>
process-management: structure the process by master.
r1887 % for proc_child in children:
<% mem = proc_child.memory_info()%>
<tr>
<td>
<code>
processes: use better naming detection of running children processes
r2166 | ${proc_child.pid} - ${get_name(proc_child)}
process-management: structure the process by master.
r1887 </code>
</td>
<td>
<a href="#showCommand" onclick="$('#pid'+${proc_child.pid}).toggle();return false"> command </a>
<code id="pid${proc_child.pid}" style="display: none">
process-management: show CPU numbers for processes.
r1888 ${' '.join(proc_child.cmdline())}
process-management: structure the process by master.
r1887 </code>
</td>
<td>
process-management: show CPU numbers for processes.
r1888 CPU: ${proc_child.cpu_percent()} %
</td>
<td>
process-management: structure the process by master.
r1887 RSS:${h.format_byte_size_binary(mem.rss)}
process-management: show sum of RSS memory for whole process tree.
r1901 <% mem_sum += mem.rss %>
process-management: structure the process by master.
r1887 </td>
<td>
VMS:${h.format_byte_size_binary(mem.vms)}
</td>
<td>
processes: show age of processes.
r2304 AGE: ${h.age_component(h.time_to_utcdatetime(proc_child.create_time()))}
</td>
<td>
process-management: structure the process by master.
r1887 <a href="#restartProcess" onclick="restart(this, ${proc_child.pid});return false">
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885 restart
</a>
process-management: structure the process by master.
r1887 </td>
</tr>
% endfor
process-management: show sum of RSS memory for whole process tree.
r1901 <tr>
<td colspan="2"><code>| total processes: ${len(children)}</code></td>
<td></td>
<td><strong>RSS:${h.format_byte_size_binary(mem_sum)}</strong></td>
<td></td>
</tr>
processes: use better naming detection of running processes
r2165 <tr><td> <code> -- </code> </td></tr>
process-management: structure the process by master.
r1887
% endif
process-managemet: added simple page to monitor worker processes of RhodeCode.
r1885 % endfor
</table>
</div>
</div>
<script>
restart = function(elem, pid) {
if ($(elem).hasClass('disabled')){
return;
}
$(elem).addClass('disabled');
$(elem).html('processing...');
$.ajax({
url: pyroutes.url('admin_settings_process_management_signal'),
headers: {
"X-CSRF-Token": CSRF_TOKEN,
},
data: JSON.stringify({'pids': [pid]}),
dataType: 'json',
type: 'POST',
contentType: "application/json; charset=utf-8",
success: function (data) {
$(elem).html(data.result);
$(elem).removeClass('disabled');
},
failure: function (data) {
$(elem).text('FAILED TO LOAD RESULT');
$(elem).removeClass('disabled');
},
error: function (data) {
$(elem).text('FAILED TO LOAD RESULT');
$(elem).removeClass('disabled');
}
})
}
</script>