This commit is contained in:
Eugenio Marzo
2022-12-29 14:09:13 +01:00
parent c120d96fcf
commit 30cf0bdbb8
3 changed files with 10 additions and 16 deletions
+2 -1
View File
@@ -264,7 +264,6 @@ experiments:
</textarea>
</div>
</form>
<div id="chaosJobLogsDiv" style="margin-top: 2%; overflow-y: scroll; height:100px;"></div>
</div>
<div class="col" style="margin-top: 4%; overflow-y: scroll; height:900px;">
<div id="chaosProgramFlow">
@@ -351,6 +350,7 @@ experiments:
<script src="./js/popper.min.js"></script>
<script>
function changeRandomFactor() {
randomFactor = $("#randomFactorInput").val();
$("#currentRandomFactor").text(randomFactor);
@@ -503,6 +503,7 @@ experiments:
$('textarea').on('input', function() {
$('#alert_placeholder2').text('');
});
</script>
</body>
</html>
+5 -9
View File
@@ -182,15 +182,11 @@ function getChaosJobsLogs() {
var oReq = new XMLHttpRequest();
oReq.onreadystatechange = function () {
if (this.readyState === XMLHttpRequest.DONE && this.status === 200) {
if (programming_mode_switch) {
document.getElementById("chaosJobLogsDiv").innerHTML = "";
document.getElementById("chaosJobLogsDiv").innerHTML = this.responseText;
}
if (log_tail_switch) {
document.getElementById("logTailDiv").innerHTML = "";
document.getElementById("logTailDiv").innerHTML = this.responseText;
}
}
if (log_tail_switch) {
document.getElementById("logTailDiv").innerHTML = "";
document.getElementById("logTailDiv").innerHTML = this.responseText;
}
}
};;
oReq.open("GET", "https://" + clu_endpoint + "/chaoslogs-" + random_code + ".html");
oReq.send();
+3 -6
View File
@@ -26,11 +26,6 @@ def compute_line(api_response_line, api_instance, container):
#store = False
sha256log = sha256(logrow.encode('utf-8')).hexdigest()
#if r.exists(f"log:{logid}:{pod.metadata.name}:{sha256log}"):
# current_row = r.get(f"log:{logid}:{pod.metadata.name}:{sha256log}")
# if current_row != logrow:
# store = True
if not r.exists(f"log:{logid}:{pod.metadata.name}:{sha256log}"):
logging.info(f"[logid:{logid}] The key log:{logid}:{pod.metadata.name}:{sha256log} does not exists. Preparing to store log content")
file = pathlib.Path('/var/www/html')
@@ -75,7 +70,9 @@ def line_prepender(filename, line, logid):
logging.info(f"[logid:{logid}] Some i/o problem occurred in function line_prepender")
# create logger
logging.basicConfig(level=os.environ.get("LOGLEVEL", "INFO"))
logging.basicConfig(level=logging.INFO)
#logging.basicConfig(filename='/tmp/example.log', encoding='utf-8', level=os.environ.get("LOGLEVEL", "INFO"))
logging.info('Starting script for KubeInvaders taking logs from pods...')
file = pathlib.Path('/tmp/redis.sock')