本文整理汇总了C++中ProcessInfo::supported方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessInfo::supported方法的具体用法?C++ ProcessInfo::supported怎么用?C++ ProcessInfo::supported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessInfo
的用法示例。
在下文中一共展示了ProcessInfo::supported方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sayMemoryStatus
/** called once a minute from killcursors thread */
void sayMemoryStatus() {
static time_t last;
static Mem mlast;
try {
ProcessInfo p;
if ( !cmdLine.quiet && p.supported() ) {
Mem m;
m.res = p.getResidentSize();
m.virt = p.getVirtualMemorySize();
m.mapped = (int) (MemoryMappedFile::totalMappedLength() / ( 1024 * 1024 ));
if( time(0)-last >= 300 || m.grew(mlast) ) {
log() << "mem (MB) res:" << m.res << " virt:" << m.virt << " mapped:" << m.mapped << endl;
if( m.virt - (cmdLine.dur?2:1)*m.mapped > 5000 ) {
ONCE log() << "warning virtual/mapped memory differential is large. journaling:" << cmdLine.dur << endl;
}
last = time(0);
mlast = m;
}
}
}
catch(...) {
log() << "ProcessInfo exception" << endl;
}
}
示例2: sayMemoryStatus
/** called once a minute from killcursors thread */
void sayMemoryStatus() {
static time_t last;
static Mem mlast;
try {
ProcessInfo p;
if ( !cmdLine.quiet && p.supported() ) {
Mem m;
m.res = p.getResidentSize();
m.virt = p.getVirtualMemorySize();
m.mapped = MemoryMappedFile::totalMappedLength() / (1024 * 1024);
time_t now = time(0);
if( now - last >= 300 || m.grew(mlast) ) {
log() << "mem (MB) res:" << m.res << " virt:" << m.virt;
long long totalMapped = m.mapped;
if (cmdLine.dur) {
totalMapped *= 2;
log() << " mapped (incl journal view):" << totalMapped;
}
else {
log() << " mapped:" << totalMapped;
}
log() << " connections:" << Listener::globalTicketHolder.used();
if (theReplSet) {
log() << " replication threads:" <<
ReplSetImpl::replWriterThreadCount +
ReplSetImpl::replPrefetcherThreadCount;
}
last = now;
mlast = m;
}
}
}
catch(const std::exception&) {
log() << "ProcessInfo exception" << endl;
}
}
示例3: TEST
TEST(ProcessInfo, SysInfoIsInitialized) {
ProcessInfo processInfo;
if (processInfo.supported()) {
ASSERT_FALSE(processInfo.getOsType().empty());
}
}