shmMonitor: Adjust output slightly

This commit is contained in:
Alexey Rybalchenko 2020-08-07 12:36:18 +02:00 committed by Dennis Klein
parent 86a1dd38a2
commit c0153a6b55
2 changed files with 11 additions and 4 deletions

View File

@ -314,10 +314,14 @@ void Monitor::CheckSegment()
<< setw(10) << (fViewOnly ? "view only" : to_string(duration)) << " |" << setw(10) << (fViewOnly ? "view only" : to_string(duration)) << " |"
<< c << flush; << c << flush;
} else if (fViewOnly) { } else if (fViewOnly) {
LOGV(info, user1) << "name: " << fSegmentName size_t free = segment.get_free_memory();
<< ", size: " << segment.get_size() size_t total = segment.get_size();
<< ", free: " << segment.get_free_memory() size_t used = total - free;
<< ", numDevices: " << numDevices; LOGV(info, user1) << "[" << fSegmentName
<< "] devices: " << numDevices
<< ", total: " << total
<< ", free: " << free
<< ", used: " << used;
} }
} catch (bie&) { } catch (bie&) {
fHeartbeatTriggered = false; fHeartbeatTriggered = false;

View File

@ -118,6 +118,9 @@ int main(int argc, char** argv)
} }
cout << "Starting shared memory monitor for session: \"" << sessionName << "\" (shmId: " << shmId << ")..." << endl; cout << "Starting shared memory monitor for session: \"" << sessionName << "\" (shmId: " << shmId << ")..." << endl;
if (viewOnly && !interactive) {
cout << "running in non-interactive view-only mode, outputting with interval of " << intervalInMS << "ms. (change with --interval), press ctrl+C to exit." << endl;
}
Monitor monitor(shmId, selfDestruct, interactive, viewOnly, timeoutInMS, intervalInMS, runAsDaemon, cleanOnExit); Monitor monitor(shmId, selfDestruct, interactive, viewOnly, timeoutInMS, intervalInMS, runAsDaemon, cleanOnExit);