Esempio n. 1
0
string PredefinedInspector::getBasicInfo(const PropertyList& argList,
    string& contentType)
{
    contentType = "text/plain";

    StrList strList;
    strList.add(formatString("path: %s", getAppExeName().c_str()));
    strList.add(formatString("pid: %d", ::getpid()));

    return strList.getText();
}
Esempio n. 2
0
string PredefinedInspector::getProcStatus(const PropertyList& argList,
    string& contentType)
{
    contentType = "text/plain";

    StrList strList;
    if (strList.loadFromFile("/proc/self/status"))
        return strList.getText();
    else
        return "";
}
Esempio n. 3
0
string PredefinedInspector::getBasicInfo(const PropertyList& argList,
    string& contentType)
{
    contentType = "text/plain";

    DWORD procId = ::GetCurrentProcessId();
    HANDLE handle = ::OpenProcess(PROCESS_QUERY_INFORMATION, false, procId);
    size_t memorySize = 0;

    PROCESS_MEMORY_COUNTERS pmc = {0};
    pmc.cb = sizeof(pmc);
    if (::GetProcessMemoryInfo(handle, &pmc, pmc.cb))
        memorySize = pmc.WorkingSetSize;

    ::CloseHandle(handle);

    StrList strList;
    strList.add(formatString("path: %s", getAppExeName().c_str()));
    strList.add(formatString("pid: %u", procId));
    strList.add(formatString("memory: %s bytes", addThousandSep(memorySize).c_str()));

    return strList.getText();
}