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:
44  ~ProcInfoFetcher();
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
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:329
bool operator>(const ProcInfo &p) const