taming the memory monster

This commit is contained in:
Sebastien
2020-03-02 18:03:47 -05:00
parent aa71866a17
commit 5ab1f04ea5
15 changed files with 583 additions and 46 deletions

View File

@@ -24,6 +24,14 @@ var nvs_type_t = {
NVS_TYPE_ANY : 0xff /*!< Must be last */
} ;
var task_state_t = {
0 : "eRunning", /*!< A task is querying the state of itself, so must be running. */
1 : "eReady", /*!< The task being queried is in a read or pending ready list. */
2 : "eBlocked", /*!< The task being queried is in the Blocked state. */
3 : "eSuspended", /*!< The task being queried is in the Suspended state, or is in the Blocked state with an infinite time out. */
4 : "eDeleted"
}
var releaseURL = 'https://api.github.com/repos/sle118/squeezelite-esp32/releases';
var recovery = false;
var enableAPTimer = true;
@@ -649,7 +657,9 @@ function refreshAPHTML(data){
function getMessages() {
$.getJSON("/messages.json", function(data) {
data.forEach(function(msg) {
var msg_age = msg["current_time"] - msg["sent_time"];
var msg_age = msg["current_time"] - msg["sent_time"];
var msg_time = new Date( );
msg_time.setTime( msg_time .getTime() - msg_age );
switch (msg["class"]) {
case "MESSAGING_CLASS_OTA":
//message: "{"ota_dsc":"Erasing flash complete","ota_pct":0}"
@@ -668,6 +678,15 @@ function getMessages() {
}
}
break;
case "MESSAGING_CLASS_STATS":
// for task states, check structure : task_state_t
var stats_data = JSON.parse(msg["message"]);
console.log(msg_time + " - Number of tasks on the ESP32: " + stats_data["ntasks"]);
var stats_tasks = stats_data["tasks"];
stats_tasks.forEach(function(task) {
console.log(msg_time + " - " + task["nme"] + ' - '+ task["cpu"]);
});
break;
case "MESSAGING_CLASS_SYSTEM":
showMessage(msg["message"], msg["type"],msg_age);
lastMsg = msg;