mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-27 07:59:59 -07:00
daemon: switch to writing heuristics output to ND-JSON
ND-JSON (newline-delimited JSON) is just a file with a list of JSON objects separated by newlines. This way, as the analyzer harness processes new packets, it can simply append JSON-serialized results to a file without parsing the entire thing first. Also simplifies the analysis stuff to all operate in the diag thread.
This commit is contained in:
@@ -33,7 +33,7 @@ function createEntryRow(entry) {
|
||||
name.scope = 'row';
|
||||
name.innerText = entry.name;
|
||||
row.appendChild(name);
|
||||
for (const key of ['start_time', 'last_message_time', 'size_bytes']) {
|
||||
for (const key of ['start_time', 'last_message_time', 'qmdl_size_bytes']) {
|
||||
const td = document.createElement('td');
|
||||
td.innerText = entry[key];
|
||||
row.appendChild(td);
|
||||
@@ -54,7 +54,10 @@ function createEntryRow(entry) {
|
||||
}
|
||||
|
||||
async function getAnalysisReport() {
|
||||
return JSON.parse(await req('GET', '/api/analysis-report'));
|
||||
const rows = await req('GET', '/api/analysis-report');
|
||||
return rows.split('\n')
|
||||
.filter(row => row.length > 0)
|
||||
.map(row => JSON.parse(row));
|
||||
}
|
||||
|
||||
async function getSystemStats() {
|
||||
|
||||
Reference in New Issue
Block a user