Commit 0c62008f authored by vehnem's avatar vehnem
Browse files

overall progress

parent 55f69243
package org.dbpedia.release.config
import java.net.URL
import java.text.SimpleDateFormat
import java.util.Calendar
import org.apache.jena.query.QueryExecutionFactory
import scala.collection.mutable.ListBuffer
/**
* Dashboard config
......@@ -135,8 +129,8 @@ object Config {
object extractionLogs {
object baseUrl {
val mappings = new URL("http://dbpedia-mappings.tib.eu/logs/")
val generic = new URL("http://dbpedia-mappings.tib.eu/logs/")
val mappings = new URL("http://dbpedia-mappings.tib.eu/logs/mappings/")
val generic = new URL("http://dbpedia-mappings.tib.eu/logs/generic/")
val wikidata = new URL("http://dbpedia-wikidata.tib.eu/logs/")
}
......
......@@ -29,7 +29,6 @@ object ReleaseLogHandler {
new URL(baseUrl, version).openStream()
)).lines().flatMap({
case HrefPattern(fileName) =>
println(fileName)
LogFile.apply(new URL(baseUrl, version + "/"), fileName) match {
case Some(logFile) => Stream.of(logFile)
case _ => Stream.of()
......
......@@ -195,28 +195,28 @@
<h4>Overall Extraction Progress</h4>
<h6>Mappings</h6>
<div class="progress">
<div class="progress-bar progress-bar-striped font-weight-bold bg-success" style="width: 100%;">
100%
<div id="mappings-progress" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
Step 0/7
</div>
</div>
<h6>Generic</h6>
<div class="progress">
<div class="progress-bar progress-bar-striped font-weight-bold bg-info" style="width: 67%;">
67%
<div id="generic-progress" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
Step 0/7
</div>
</div>
<h6>Wikidata</h6>
<div class="progress">
<div class="progress-bar progress-bar-striped font-weight-bold bg-warning" style="width: 33%;">
33%
<div id="wikidata-progress" class="progress-bar progress-bar-striped font-weight-bold" style="width: 100%;">
Step 0/7
</div>
</div>
<h6>Text</h6>
<!-- <h6>Text</h6>
<div class="progress">
<div class="progress-bar progress-bar-striped font-weight-bold bg-danger" style="width: 10%;">
Step 0/7
</div>
</div>
</div> -->
</div>
</div>
</div>
......@@ -292,7 +292,7 @@
<thead>
<th data-field="state">State</th>
<th data-field="artifact">Artifact</th>
<th data-field="missing">Missing</th>
<th data-field="missing">Missing Files</th>
</thead>
</table>
</div>
......@@ -370,7 +370,7 @@
<thead>
<th data-field="state">State</th>
<th data-field="artifact">Artifact</th>
<th data-field="missing">Missing</th>
<th data-field="missing">Missing Files</th>
</thead>
</table>
</div>
......@@ -448,7 +448,7 @@
<thead>
<th data-field="state">State</th>
<th data-field="artifact">Artifact</th>
<th data-field="missing">Missing</th>
<th data-field="missing">Missing Files</th>
</thead>
</table>
</div>
......
......@@ -83,9 +83,10 @@ function getLogs(group) {
var logTable = $(`#${group}-logs-table`)
$.getJSON(api + `release/logs/wikidata/2020.05.01`, function (data) {
$.getJSON(api + `release/logs/${group}/${version}`, function (data) {
var processLogs = []
var doneSteps = 0
data.forEach(element => {
......@@ -99,6 +100,7 @@ function getLogs(group) {
state = '<strong class="text-success">RUN</strong>'
} else {
stateVal = 2
doneSteps += 1
state = '<strong class="text-info">DONE</strong>'
}
......@@ -108,10 +110,26 @@ function getLogs(group) {
processLogs.push({ 'state': state, 'description': description, 'filename': `<a href="${url}">${file}</a>` })
})
setProgress(group, doneSteps, 6)
logTable.bootstrapTable({ 'data': processLogs })
});
}
function setProgress(group, actual, max) {
let progBar = $(`#${group}-progress`)
let percent = actual * 100 / max
progBar.html(`(${actual}/${max}) Steps`)
progBar.css('width', percent + '%')
if (percent >= 100.0) {
progBar.addClass('bg-success')
} else if (actual == 0.0) {
progBar.css('width', '100%')
progBar.addClass('bg-secondary')
} else {
progBar .addClass('bg-warning')
}
}
$(function () {
getLogs('mappings')
......@@ -171,15 +189,15 @@ function checkCompleteness(group, expectedArtifacts) {
}
function setProgressBar(bar, actual, max) {
bar.html(`$(${actual}/${expected})`)
bar.html(`(${actual}/${max})`)
var percentage = actual * 100 / max
bar.css('width', percentage + '%')
if (percentage >= 100.0)
bar.addClass('bg-info')
else if (actual == 0.0)
else if (actual == 0.0) {
bar.css('width', '100%')
bar.addClass('bg-danger')
else
} else
bar.addClass('bg-warning')
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment