当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessInfo::supported方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:ealliaume,项目名称:mongo,代码行数:25,代码来源:clientcursor.cpp

示例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;
     }
 }
开发者ID:Xyand,项目名称:mongo,代码行数:37,代码来源:clientcursor.cpp

示例3: TEST

 TEST(ProcessInfo, SysInfoIsInitialized) {
     ProcessInfo processInfo;
     if (processInfo.supported()) {
         ASSERT_FALSE(processInfo.getOsType().empty());
     }
 }
开发者ID:10genReviews,项目名称:mongo,代码行数:6,代码来源:processinfo_test.cpp


注:本文中的ProcessInfo::supported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。