Replace the 'memorypercentage' API call with 'memorystats', which returns

much more meaningfull information to let us do graphs and whatnot

REST Request:
-------------------------------
PUT /sysadm/systeminfo
{
   "action" : "memorystats"
}

REST Response:
-------------------------------
{
    "args": {
        "memorystats": {
            "active": "818",
            "cache": "69",
            "free": "4855",
            "inactive": "2504",
            "wired": "1598"
        }
    }
}

WebSocket Request:
-------------------------------
{
   "args" : {
      "action" : "memorystats"
   },
   "namespace" : "sysadm",
   "id" : "fooid",
   "name" : "systeminfo"
}

WebSocket Response:
-------------------------------
{
  "args": {
    "memorystats": {
      "active": "826",
      "cache": "69",
      "free": "4847",
      "inactive": "2505",
      "wired": "1598"
    }
  },
  "id": "fooid",
  "name": "response",
  "namespace": "sysadm"
}
This commit is contained in:
Kris Moore
2016-01-25 15:51:43 -05:00
parent d873746bfe
commit ccd41322bd
3 changed files with 51 additions and 14 deletions

View File

@@ -271,9 +271,9 @@ RestOutputStruct::ExitCode WebSocket::EvaluateSysadmSystemInfoRequest(const QJso
ok = true;
out->insert("externalmounts", sysadm::SysInfo::externalDevicePaths());
}
if(act=="memorypercentage"){
if(act=="memorystats"){
ok = true;
out->insert("memorypercentage", sysadm::SysInfo::memoryPercentage());
out->insert("memorystats", sysadm::SysInfo::memoryStats());
}
if(act=="systeminfo"){
ok = true;