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  {
30  ProcInfo():vsize(),rss() {}
31  ProcInfo(double sz, double rss_sz): vsize(sz),rss(rss_sz) {}
32 
33  bool operator==(const ProcInfo& p) const
34  { return vsize==p.vsize && rss==p.rss; }
35 
36  bool operator>(const ProcInfo& p) const
37  { return vsize>p.vsize || rss>p.rss; }
38 
39  // see proc(4) man pages for units and a description
40  double vsize; // in MB (used to be in pages?)
41  double rss; // in MB (used to be in pages?)
42  };
43 
45  public:
47  ~ProcInfoFetcher();
48  ProcInfoFetcher(ProcInfoFetcher const&) = delete;
49  ProcInfoFetcher& operator=(ProcInfoFetcher const&) = delete;
50 
51  ProcInfo fetch() const;
52  private:
53  double pg_size_;
54  int fd_;
55  mutable char buf_[500];
56  };
57  }
58 }
59 #endif
ProcInfo(double sz, double rss_sz)
bool operator==(const ProcInfo &p) const
HLT enums.
std::pair< std::string, std::shared_ptr< void > > fetch(const cond::Hash &payloadId, Session &session)
Definition: CondDBFetch.cc:323
bool operator>(const ProcInfo &p) const