00001 // @file dur_stats.h 00002 00003 namespace mongo { 00004 namespace dur { 00005 00009 struct Stats { 00010 Stats(); 00011 void rotate(); 00012 BSONObj asObj(); 00013 unsigned _intervalMicros; 00014 struct S { 00015 BSONObj _asObj(); 00016 void reset(); 00017 00018 unsigned _commits; 00019 unsigned _earlyCommits; // count of early commits from commitIfNeeded() or from getDur().commitNow() 00020 unsigned long long _journaledBytes; 00021 unsigned long long _writeToDataFilesBytes; 00022 00023 unsigned long long _prepLogBufferMicros; 00024 unsigned long long _writeToJournalMicros; 00025 unsigned long long _writeToDataFilesMicros; 00026 unsigned long long _remapPrivateViewMicros; 00027 00028 // undesirable to be in write lock for the group commit (it can be done in a read lock), so good if we 00029 // have visibility when this happens. can happen for a couple reasons 00030 // - read lock starvation 00031 // - file being closed 00032 // - data being written faster than the normal group commit interval 00033 unsigned _commitsInWriteLock; 00034 00035 unsigned _dtMillis; 00036 }; 00037 S *curr; 00038 private: 00039 S _a,_b; 00040 unsigned long long _lastRotate; 00041 S* other(); 00042 }; 00043 extern Stats stats; 00044 00045 } 00046 }