CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 // $Id: ProcInfoFetcher.h,v 1.1 2012/05/06 19:11:56 chrjones Exp $
20 //
21 
22 // system include files
23 
24 // user include files
25 
26 // forward declarations
27 namespace edm {
28  namespace service {
29  struct ProcInfo
30  {
31  ProcInfo():vsize(),rss() {}
32  ProcInfo(double sz, double rss_sz): vsize(sz),rss(rss_sz) {}
33 
34  bool operator==(const ProcInfo& p) const
35  { return vsize==p.vsize && rss==p.rss; }
36 
37  bool operator>(const ProcInfo& p) const
38  { return vsize>p.vsize || rss>p.rss; }
39 
40  // see proc(4) man pages for units and a description
41  double vsize; // in MB (used to be in pages?)
42  double rss; // in MB (used to be in pages?)
43  };
44 
46  public:
49  ProcInfoFetcher(ProcInfoFetcher const&) = delete;
50  ProcInfoFetcher& operator=(ProcInfoFetcher const&) = delete;
51 
52  ProcInfo fetch() const;
53  private:
54  double pg_size_;
55  int fd_;
56  mutable char buf_[500];
57  };
58  }
59 }
60 #endif
ProcInfo(double sz, double rss_sz)
ProcInfoFetcher & operator=(ProcInfoFetcher const &)=delete
bool operator==(const ProcInfo &p) const
bool operator>(const ProcInfo &p) const