Skip to content

Commit

Permalink
Web Dashboard: added a page for displaying info on worker result files
Browse files Browse the repository at this point in the history
Minir improvements and fixes on other pages.
  • Loading branch information
iagaponenko committed Dec 7, 2023
1 parent ccf01ed commit dde70d2
Show file tree
Hide file tree
Showing 7 changed files with 358 additions and 19 deletions.
24 changes: 24 additions & 0 deletions src/www/qserv/css/QservWorkerFiles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#fwk-qserv-files-controls label {
font-weight: bold;
}
table#fwk-qserv-files caption {
caption-side: top;
text-align: right;
padding-top: 0;
}
table#fwk-qserv-files > thead > tr > th.sticky {
position:sticky;
top:80px;
z-index:2;
}
table#fwk-qserv-files tbody th,
table#fwk-qserv-files tbody td {
vertical-align:middle;
}
table#fwk-qserv-files pre {
padding: 0;
margin: 0;
}
table#fwk-qserv-files caption.updating {
background-color: #ffeeba;
}
3 changes: 3 additions & 0 deletions src/www/qserv/css/QservWorkerResultsFilesystem.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ table#fwk-qserv-results-filesystem > thead > tr > th.sticky {
top:80px;
z-index:2;
}
table#fwk-qserv-results-filesystem tbody > tr.display-worker-files:hover {
cursor:pointer;
}
12 changes: 11 additions & 1 deletion src/www/qserv/js/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function(sqlFormatter,
_) {

class Common {
static RestAPIVersion = 27;
static RestAPIVersion = 28;
static query2text(query, expanded) {
if (expanded) {
return sqlFormatter.format(query, Common._sqlFormatterConfig);
Expand Down Expand Up @@ -37,6 +37,16 @@ function(sqlFormatter,
}, '') + `
</select>`;
}
static KB = 1000;
static MB = 1000 * 1000;
static GB = 1000 * 1000 * 1000;
static format_data_rate(v) {
if (v == 0) return v + ""; // as string
else if (v < Common.KB * 10) return v.toFixed(0);
else if (v < Common.MB * 10) return (v / Common.KB).toFixed(0) + " KB";
else if (v < Common.GB * 10) return (v / Common.MB).toFixed(0) + " MB";
else return (v / Common.GB).toFixed(0) + " GB";
}
}
return Common;
});
22 changes: 6 additions & 16 deletions src/www/qserv/js/QservCzarStatistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function(CSSLoader,
if (runTimeSec > 0) {
const perf = data.qdisp_stats[counter] / runTimeSec;
if (QservCzarStatistics._totals_data_rate.has(counter)) {
that._set_counter_perf('totals', counter, QservCzarStatistics._format_data_rate(perf), '_sum');
that._set_counter_perf('totals', counter, Common.format_data_rate(perf), '_sum');
} else {
that._set_counter_perf('totals', counter, perf.toFixed(0), '_sum');
}
Expand All @@ -281,7 +281,7 @@ function(CSSLoader,
if (deltaT > 0) {
const perf = deltaVal / deltaT;
if (QservCzarStatistics._totals_data_rate.has(counter)) {
that._set_counter_perf('totals', counter, QservCzarStatistics._format_data_rate(perf));
that._set_counter_perf('totals', counter, Common.format_data_rate(perf));
} else {
that._set_counter_perf('totals', counter, perf.toFixed(0));
}
Expand Down Expand Up @@ -366,26 +366,16 @@ function(CSSLoader,
}, '') + `
</tbody>`;
}
static _KB = 1000;
static _MB = 1000 * 1000;
static _GB = 1000 * 1000 * 1000;
static _format_bucket_limit(v, data_rate=false) {
if (isNaN(v)) return v;
if (data_rate) {
if (v < QservCzarStatistics._KB) return v + " B/s";
else if (v < QservCzarStatistics._MB) return (v / QservCzarStatistics._KB).toFixed(0) + " KB/s";
else if (v < QservCzarStatistics._GB) return (v / QservCzarStatistics._MB).toFixed(0) + " MB/s";
return (v / QservCzarStatistics._GB).toFixed(0) + " GB/s";
if (v < Common.KB) return v + " B/s";
else if (v < Common.MB) return (v / Common.KB).toFixed(0) + " KB/s";
else if (v < Common.GB) return (v / Common.MB).toFixed(0) + " MB/s";
return (v / Common.GB).toFixed(0) + " GB/s";
}
return v.toLocaleString();
}
static _format_data_rate(v) {
if (v == 0) return v + ""; // as string
else if (v < QservCzarStatistics._KB * 10) return v.toFixed(0);
else if (v < QservCzarStatistics._MB * 10) return (v / QservCzarStatistics._KB).toFixed(0) + " KB";
else if (v < QservCzarStatistics._GB * 10) return (v / QservCzarStatistics._MB).toFixed(0) + " MB";
else return (v / QservCzarStatistics._GB).toFixed(0) + " GB";
}

/**
* @param {Number} seconds
Expand Down
3 changes: 3 additions & 0 deletions src/www/qserv/js/QservMonitoringDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ require([
'qserv/QservWorkerTasks',
'qserv/QservWorkerTaskHist',
'qserv/QservWorkerResultsFilesystem',
'qserv/QservWorkerFiles',
'qserv/QservWorkerConfig',
'qserv/ReplicationController',
'qserv/ReplicationTools',
Expand Down Expand Up @@ -101,6 +102,7 @@ function(CSSLoader,
QservWorkerTasks,
QservWorkerTaskHist,
QservWorkerResultsFilesystem,
QservWorkerFiles,
QservWorkerConfig,
ReplicationController,
ReplicationTools,
Expand Down Expand Up @@ -175,6 +177,7 @@ function(CSSLoader,
new QservWorkerTasks('Tasks'),
new QservWorkerTaskHist('Task Histograms'),
new QservWorkerResultsFilesystem('Results Filesystem'),
new QservWorkerFiles('Files'),
new QservWorkerConfig('Config')
]
},
Expand Down
Loading

0 comments on commit dde70d2

Please sign in to comment.