od-database/templates/stats.html
2018-07-15 21:21:57 -04:00

143 lines
5.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "layout.html" %}
{% set title = "Stats - OD-Database" %}
{% set current_page = "stats" %}
{% block body %}
<div class="container">
<div class="card">
<div class="card-header">Statistics</div>
<div class="card-body">
<div id="chart-wrapper" style="margin-bottom: 1em">
<p id="loading-text">Calculating...</p>
<canvas id="typesChart"></canvas>
</div>
<div id="chart-wrapper" style="margin-bottom: 1em">
<canvas id="sizeHistogram"></canvas>
</div>
<div id="chart-wrapper" style="margin-bottom: 1em">
<canvas id="dateHistogram"></canvas>
</div>
<div id="chart-wrapper" style="margin-bottom: 1em">
<canvas id="websiteScatter"></canvas>
</div>
<h4>Database stats</h4>
<table class="table table-striped">
<tbody>
<tr>
<th>Database index size</th>
<td id="esIndexSize"></td>
</tr>
<tr>
<th>Query count</th>
<td id="esSearchCount"></td>
</tr>
<tr>
<th>Total query time</th>
<td id="esSearchTime"></td>
</tr>
<tr>
<th>Average time per query</th>
<td id="esSearchTimeAvg"></td>
</tr>
<tr>
<th>Total file count</th>
<td id="totalCount"></td>
</tr>
<tr>
<th>Size total</th>
<td id="totalSize"></td>
</tr>
<tr>
<th>Size average</th>
<td id="sizeAvg"></td>
</tr>
<tr>
<th>Size standard deviation</th>
<td id="sizeStdDeviation"></td>
</tr>
<tr>
<th>Size standard deviation bounds (σ = 1)</th>
<td id="sizeStdDeviationBounds"></td>
</tr>
<tr>
<th>Size variance</th>
<td id="sizeVariance"></td>
</tr>
</tbody>
</table>
<h4>Crawl server stats</h4>
<table class="table table-striped">
<thead>
<tr>
<th></th>
{% for server in crawl_server_stats %}
<th>{{ server }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
<tr>
<th>Completed tasks</th>
{% for server in crawl_server_stats %}
<td>{{ crawl_server_stats[server].task_count }}</td>
{% endfor %}
</tr>
<tr>
<th>Crawl time</th>
{% for server in crawl_server_stats %}
<td>{{ crawl_server_stats[server].time|round(2) }}s</td>
{% endfor %}
</tr>
<tr>
<th>Crawl time average</th>
{% for server in crawl_server_stats %}
<td>{{ crawl_server_stats[server].time_avg|round(2) }}s</td>
{% endfor %}
</tr>
<tr>
<th>Files crawled</th>
{% for server in crawl_server_stats %}
<td>{{ crawl_server_stats[server].file_count }}</td>
{% endfor %}
</tr>
<tr>
<th>Files crawled average</th>
{% for server in crawl_server_stats %}
<td>{{ crawl_server_stats[server].file_count_avg | round(2) }}</td>
{% endfor %}
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script src="/static/js/report.js"></script>
<script>
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
let rData = JSON.parse(this.responseText);
drawChart(rData);
drawSizeHistogram(rData);
drawDateHistogram(rData);
drawWebsiteScatter(rData);
fillDatabaseTable(rData);
document.getElementById("loading-text").innerHTML = "";
}
};
xhttp.open("GET", "/stats/json_chart", true);
xhttp.send();
</script>
{% endblock body %}