File indexing completed on 2024-04-06 12:13:05
0001 #ifndef FWCore_Services_ProcInfoFetcher_h
0002 #define FWCore_Services_ProcInfoFetcher_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 namespace edm {
0027 namespace service {
0028 struct ProcInfo {
0029 ProcInfo() : vsize(), rss() {}
0030 ProcInfo(double sz, double rss_sz) : vsize(sz), rss(rss_sz) {}
0031
0032 bool operator==(const ProcInfo& p) const { return vsize == p.vsize && rss == p.rss; }
0033
0034 bool operator>(const ProcInfo& p) const { return vsize > p.vsize || rss > p.rss; }
0035
0036
0037 double vsize;
0038 double rss;
0039 };
0040
0041 class ProcInfoFetcher {
0042 public:
0043 ProcInfoFetcher();
0044 ~ProcInfoFetcher();
0045 ProcInfoFetcher(ProcInfoFetcher const&) = delete;
0046 ProcInfoFetcher& operator=(ProcInfoFetcher const&) = delete;
0047
0048 ProcInfo fetch() const;
0049
0050 private:
0051 double pg_size_;
0052 int fd_;
0053 mutable char buf_[500];
0054 };
0055 }
0056 }
0057 #endif