{% extends "admin/base_site.html" %}

{% load i18n %}


{% block breadcrumbs %}
<div class="breadcrumbs">
    <a href="../">{% trans 'Home' %}</a> &rsaquo;
    {% trans 'uWSGI' %}
</div>
{% endblock %}


{% block content %}
<div id="content-main">
<h1>uWSGI status</h1>
<b>masterpid:</b> {{masterpid}}<br/>
<b>started_on:</b> {{started_on}}<br/>
<b>buffer size:</b> {{buffer_size}}<br/>
<b>workers:</b> {{numproc}}<br/>
<b>total requests:</b> {{total_requests}}<br/>

<br/>

<div class="module" style="width:860px">
<table>
	<caption style="width:860px">workers</caption>
	<thead>
		<tr>
			<th scope="row">id</th>
			<th scope="row">pid</th>
			<th scope="row">requests</th>
			<th scope="row">running time (milliseconds)</th>
			<th scope="row">load</th>
			<th scope="row">last spawn</th>
			<th scope="row">respawn count</th>
			<th scope="row">address space (vsz)</th>
			<th scope="row">resident memory (rss)</th>
		</tr>
	</thead>
	<tbody>
{% for w in workers %}
	<tr>
		<td align="center">{{w.id}}</td>
		<td align="center">{{w.pid}}</td>
		<td align="right">{{w.requests}}</td>
		<td align="right">{{w.running_time}}</td>
		<td align="right">{{w.load|floatformat:2}} %</td>
		<td align="right">{{w.last_spawn_str}}</td>
		<td align="right">{{w.respawn_count}}</td>
		<td align="right">{{w.vsz|filesizeformat}}</td>
		<td align="right">{{w.rss|filesizeformat}}</td>
	</tr>
{% endfor %}
	</tbody>
</table>
</div>

<div class="module" style="width:860px">
<table>
	<caption style="width:860px">spooler jobs</caption>
	<thead>
		<tr>
			<th scope="row">job filename</th>
			<th scope="row">environment</th>
		</tr>
	</thead>
	<tbody>
{% for j in jobs %}
	<tr>
		<td align="left">{{j.file}}</td>
		<td align="left">{{j.env}}</td>
	</tr>
{% endfor %}
	</tbody>
</table>
</div>

{% if masterpid %}
<br/>
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="reload/" method="post">
{% csrf_token %}
<input type="submit" value="gracefully reload uWSGI" name="_reload"/>
</form>
{% endif %}

</div>

{% endblock %}

