db connection stats

This commit is contained in:
2020-06-01 14:39:22 +02:00
parent f3b4c8b477
commit 98503a385b
3 changed files with 27 additions and 1 deletions

View File

@@ -117,6 +117,19 @@ function getStats(order) {
).then(resp => {
let t = document.getElementById("tstat_body")
t.innerHTML = ""
let c = document.getElementById("tconnstat_body")
c.innerHTML = ""
resp.db_connection_stats.forEach(v => {
let row = document.createElement("tr")
row.innerHTML = `\
<td>${v.name}</td>
<td>${v.max_connections}</td>
<td>${v.open_connections}</td>
<td>${v.connections_in_use}</td>
<td>${v.connections_idle}</td>`
c.appendChild(row)
})
resp.query_statistics.sort((a, b) => {
if (typeof(a[order]) === "number") {

View File

@@ -55,7 +55,7 @@ FileManager.prototype.getUserFiles = function() {
this.setSpinner()
let getAll = (page) => {
let numFiles = 10000
let numFiles = 1000
fetch(apiEndpoint+"/user/files?page="+page+"&limit="+numFiles).then(resp => {
if (!resp.ok) { Promise.reject("yo") }
return resp.json()

View File

@@ -27,6 +27,19 @@
<hr/>
<div class="limit_width">
<a href="/admin/globals">Update global settings</a>
<h3>Database connection statistics</h3>
<table>
<thead>
<tr>
<td>Name</td>
<td>Max</td>
<td>Open</td>
<td>In use</td>
<td>Idle</td>
</tr>
</thead>
<tbody id="tconnstat_body"></tbody>
</table>
<h3>Query statistics</h3>
<table>
<thead>