CMS 3D CMS Logo

ProcInfoFetcher.h
Go to the documentation of this file.
1 #ifndef FWCore_Services_ProcInfoFetcher_h
2 #define FWCore_Services_ProcInfoFetcher_h
3 // -*- C++ -*-
4 //
5 // Package: Services
6 // Class : ProcInfoFetcher
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Sun May 6 11:14:28 CDT 2012
19 //
20 
21 // system include files
22 
23 // user include files
24 
25 // forward declarations
26 namespace edm {
27  namespace service {
28  struct ProcInfo {
29  ProcInfo() : vsize(), rss() {}
30  ProcInfo(double sz, double rss_sz) : vsize(sz), rss(rss_sz) {}
31 
32  bool operator==(const ProcInfo& p) const { return vsize == p.vsize && rss == p.rss; }
33 
34  bool operator>(const ProcInfo& p) const { return vsize > p.vsize || rss > p.rss; }
35 
36  // see proc(4) man pages for units and a description
37  double vsize; // in MB (used to be in pages?)
38  double rss; // in MB (used to be in pages?)
39  };
40 
42  public:
45  ProcInfoFetcher(ProcInfoFetcher const&) = delete;
46  ProcInfoFetcher& operator=(ProcInfoFetcher const&) = delete;
47 
48  ProcInfo fetch() const;
49 
50  private:
51  double pg_size_;
52  int fd_;
53  mutable char buf_[500];
54  };
55  } // namespace service
56 } // namespace edm
57 #endif
edm::service::ProcInfoFetcher::ProcInfoFetcher
ProcInfoFetcher()
Definition: ProcInfoFetcher.cc:171
service
Definition: service.py:1
edm::service::ProcInfo::vsize
double vsize
Definition: ProcInfoFetcher.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::service::ProcInfo::operator>
bool operator>(const ProcInfo &p) const
Definition: ProcInfoFetcher.h:34
edm::service::ProcInfo::operator==
bool operator==(const ProcInfo &p) const
Definition: ProcInfoFetcher.h:32
edm::service::ProcInfoFetcher::pg_size_
double pg_size_
Definition: ProcInfoFetcher.h:51
edm::service::ProcInfo::rss
double rss
Definition: ProcInfoFetcher.h:38
edm::service::ProcInfoFetcher::~ProcInfoFetcher
~ProcInfoFetcher()
Definition: ProcInfoFetcher.cc:181
edm::service::ProcInfoFetcher::operator=
ProcInfoFetcher & operator=(ProcInfoFetcher const &)=delete
edm::service::ProcInfo
Definition: ProcInfoFetcher.h:28
edm::service::ProcInfo::ProcInfo
ProcInfo()
Definition: ProcInfoFetcher.h:29
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::service::ProcInfo::ProcInfo
ProcInfo(double sz, double rss_sz)
Definition: ProcInfoFetcher.h:30
edm::service::ProcInfoFetcher::fd_
int fd_
Definition: ProcInfoFetcher.h:52
edm::service::ProcInfoFetcher::fetch
ProcInfo fetch() const
Definition: ProcInfoFetcher.cc:186
edm::service::ProcInfoFetcher::buf_
char buf_[500]
Definition: ProcInfoFetcher.h:53
edm::service::ProcInfoFetcher
Definition: ProcInfoFetcher.h:41