Changeset 647 for trunk/pdns/pdns/rec_channel_rec.cc
- Timestamp:
- 04/01/06 22:26:47 (4 years ago)
- Files:
-
- 1 modified
-
trunk/pdns/pdns/rec_channel_rec.cc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/rec_channel_rec.cc
r631 r647 12 12 #include <sys/stat.h> 13 13 #include <fcntl.h> 14 #include <sys/time.h> 15 #include <sys/resource.h> 14 16 #include "logger.hh" 15 17 … … 19 21 map<string, const uint64_t*> d_get64bitpointers; 20 22 map<string, function< uint32_t() > > d_get32bitmembers; 21 22 23 23 24 void addGetStat(const string& name, const uint32_t* place) … … 33 34 d_get32bitmembers[name]=f; 34 35 } 35 36 37 36 38 37 optional<uint64_t> get(const string& name) … … 105 104 } 106 105 106 107 static uint64_t getSysTimeMsec() 108 { 109 struct rusage ru; 110 getrusage(RUSAGE_SELF, &ru); 111 return(ru.ru_stime.tv_sec*1000 + ru.ru_stime.tv_usec/1000); 112 } 113 114 static uint64_t getUserTimeMsec() 115 { 116 struct rusage ru; 117 getrusage(RUSAGE_SELF, &ru); 118 return(ru.ru_utime.tv_sec*1000 + ru.ru_utime.tv_usec/1000); 119 } 120 121 107 122 RecursorControlParser::RecursorControlParser() 108 123 { … … 138 153 139 154 addGetStat("query-rate", getQueryRate); 155 156 addGetStat("user-msec", getUserTimeMsec); 157 addGetStat("sys-msec", getSysTimeMsec); 140 158 } 141 159