[rhmessaging-commits] rhmessaging commits: r1871 - in store/trunk: cpp/lib/gen/qpid/management and 2 other directories.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Apr 8 16:25:24 EDT 2008


Author: kpvdr
Date: 2008-04-08 16:25:24 -0400 (Tue, 08 Apr 2008)
New Revision: 1871

Modified:
   store/trunk/cpp/lib/JournalImpl.cpp
   store/trunk/cpp/lib/JournalImpl.h
   store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
   store/trunk/cpp/lib/gen/qpid/management/Journal.h
   store/trunk/cpp/lib/jrnl/jcntl.hpp
   store/trunk/cpp/lib/jrnl/wmgr.cpp
   store/trunk/specs/management-schema.xml
Log:
Additional journal management instrumentation: Journal depth (hilo) and Outstanding AIOs (hilo)

Modified: store/trunk/cpp/lib/JournalImpl.cpp
===================================================================
--- store/trunk/cpp/lib/JournalImpl.cpp	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/JournalImpl.cpp	2008-04-08 20:25:24 UTC (rev 1871)
@@ -257,7 +257,10 @@
     handleIoResult(jcntl::enqueue_data_record(data_buff, tot_data_len, this_data_len, dtokp, transient));
     
     if (_mgmtObject.get() != 0)
+    {
         _mgmtObject->inc_journalRecordEnqueues();
+        _mgmtObject->inc_journalRecordDepth();
+    }
 }
 
 void
@@ -267,7 +270,10 @@
     handleIoResult(jcntl::enqueue_extern_data_record(tot_data_len, dtokp, transient));
     
     if (_mgmtObject.get() != 0)
+    {
         _mgmtObject->inc_journalRecordEnqueues();
+        _mgmtObject->inc_journalRecordDepth();
+    }
 }
 
 void
@@ -277,7 +283,10 @@
     handleIoResult(jcntl::enqueue_txn_data_record(data_buff, tot_data_len, this_data_len, dtokp, xid, transient));
     
     if (_mgmtObject.get() != 0)
+    {
         _mgmtObject->inc_journalRecordEnqueues();
+        _mgmtObject->inc_journalRecordDepth();
+    }
 }
 
 void
@@ -287,7 +296,10 @@
     handleIoResult(jcntl::enqueue_extern_txn_data_record(tot_data_len, dtokp, xid, transient));
     
     if (_mgmtObject.get() != 0)
+    {
         _mgmtObject->inc_journalRecordEnqueues();
+        _mgmtObject->inc_journalRecordDepth();
+    }
 }
 
 void
@@ -296,7 +308,10 @@
     handleIoResult(jcntl::dequeue_data_record(dtokp));
     
     if (_mgmtObject.get() != 0)
+    {
         _mgmtObject->inc_journalRecordDequeues();
+        _mgmtObject->dec_journalRecordDepth();
+    }
 }
 
 void
@@ -305,7 +320,10 @@
     handleIoResult(jcntl::dequeue_txn_data_record(dtokp, xid));
     
     if (_mgmtObject.get() != 0)
+    {
         _mgmtObject->inc_journalRecordDequeues();
+        _mgmtObject->dec_journalRecordDepth();
+    }
 }
 
 void

Modified: store/trunk/cpp/lib/JournalImpl.h
===================================================================
--- store/trunk/cpp/lib/JournalImpl.h	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/JournalImpl.h	2008-04-08 20:25:24 UTC (rev 1871)
@@ -177,6 +177,14 @@
             }
             static void aio_wr_callback(jcntl* journal, std::vector<journal::data_tok*>& dtokl);
             // static void aio_rd_callback(jcntl* journal, std::vector<u_int16_t>& pil);
+
+            // Management instrumentation callbacks overridden from jcntl
+            inline void instr_incr_outstanding_aio_cnt() {
+                if (_mgmtObject.get() != 0) _mgmtObject->inc_journalOutstandingAIOs();
+            }
+            inline void instr_decr_outstanding_aio_cnt() {
+                if (_mgmtObject.get() != 0) _mgmtObject->dec_journalOutstandingAIOs();
+            }
         }; // class JournalImpl
 
     } // namespace bdbstore

Modified: store/trunk/cpp/lib/gen/qpid/management/Journal.cpp
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.cpp	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.cpp	2008-04-08 20:25:24 UTC (rev 1871)
@@ -37,7 +37,7 @@
 string  Journal::packageName  = string ("mrgstore");
 string  Journal::className    = string ("journal");
 uint8_t Journal::md5Sum[16]   =
-    {0x59,0x12,0x32,0xe1,0x16,0x75,0xbe,0x3,0xf,0x2,0x6,0x82,0x84,0xd5,0xf,0x52};
+    {0x7f,0x89,0x7d,0x90,0xac,0xec,0x28,0xb2,0x5a,0xe3,0x4a,0xea,0xf4,0x79,0xee,0xbe};
 
 Journal::Journal (Manageable* _core) :
     ManagementObject(_core)
@@ -52,6 +52,9 @@
     journalRecordDepthLow  = 0;
     journalRecordEnqueues = 0;
     journalRecordDequeues = 0;
+    journalOutstandingAIOs = 0;
+    journalOutstandingAIOsHigh = 0;
+    journalOutstandingAIOsLow  = 0;
     journalFreeFileCount = 0;
     journalFreeFileCountHigh = 0;
     journalFreeFileCountLow  = 0;
@@ -98,7 +101,7 @@
     buf.putShortString (className);   // Class Name
     buf.putBin128      (md5Sum);      // Schema Hash
     buf.putShort       (7); // Config Element Count
-    buf.putShort       (24); // Inst Element Count
+    buf.putShort       (27); // Inst Element Count
     buf.putShort       (2); // Method Count
     buf.putShort       (0); // Event Count
 
@@ -221,6 +224,27 @@
     buf.put (ft);
 
     ft = FieldTable ();
+    ft.setString (NAME,   "journalOutstandingAIOs");
+    ft.setInt    (TYPE,   TYPE_U32);
+    ft.setString (UNIT,   "record");
+    ft.setString (DESC,   "Number of outstanding AIO requests in Async IO system");
+    buf.put (ft);
+
+    ft = FieldTable ();
+    ft.setString (NAME,   "journalOutstandingAIOsHigh");
+    ft.setInt    (TYPE,   TYPE_U32);
+    ft.setString (UNIT,   "record");
+    ft.setString (DESC,   "Number of outstanding AIO requests in Async IO system (High)");
+    buf.put (ft);
+
+    ft = FieldTable ();
+    ft.setString (NAME,   "journalOutstandingAIOsLow");
+    ft.setInt    (TYPE,   TYPE_U32);
+    ft.setString (UNIT,   "record");
+    ft.setString (DESC,   "Number of outstanding AIO requests in Async IO system (Low)");
+    buf.put (ft);
+
+    ft = FieldTable ();
     ft.setString (NAME,   "journalFreeFileCount");
     ft.setInt    (TYPE,   TYPE_U32);
     ft.setString (UNIT,   "file");
@@ -403,6 +427,9 @@
     buf.putLong (journalRecordDepthLow);
     buf.putLongLong (journalRecordEnqueues);
     buf.putLongLong (journalRecordDequeues);
+    buf.putLong (journalOutstandingAIOs);
+    buf.putLong (journalOutstandingAIOsHigh);
+    buf.putLong (journalOutstandingAIOsLow);
     buf.putLong (journalFreeFileCount);
     buf.putLong (journalFreeFileCountHigh);
     buf.putLong (journalFreeFileCountLow);
@@ -424,6 +451,8 @@
     // Maintenance of hi-lo statistics
     journalRecordDepthHigh = journalRecordDepth;
     journalRecordDepthLow  = journalRecordDepth;
+    journalOutstandingAIOsHigh = journalOutstandingAIOs;
+    journalOutstandingAIOsLow  = journalOutstandingAIOs;
     journalFreeFileCountHigh = journalFreeFileCount;
     journalFreeFileCountLow  = journalFreeFileCount;
     journalAvailableFileCountHigh = journalAvailableFileCount;

Modified: store/trunk/cpp/lib/gen/qpid/management/Journal.h
===================================================================
--- store/trunk/cpp/lib/gen/qpid/management/Journal.h	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/gen/qpid/management/Journal.h	2008-04-08 20:25:24 UTC (rev 1871)
@@ -56,6 +56,9 @@
     uint32_t  journalRecordDepthLow;
     uint64_t  journalRecordEnqueues;
     uint64_t  journalRecordDequeues;
+    uint32_t  journalOutstandingAIOs;
+    uint32_t  journalOutstandingAIOsHigh;
+    uint32_t  journalOutstandingAIOsLow;
     uint32_t  journalFreeFileCount;
     uint32_t  journalFreeFileCountHigh;
     uint32_t  journalFreeFileCountLow;
@@ -185,6 +188,20 @@
         journalRecordDequeues -= by;
         instChanged = true;
     }
+    inline void inc_journalOutstandingAIOs (uint32_t by = 1){
+        sys::RWlock::ScopedWlock writeLock (accessLock);
+        journalOutstandingAIOs += by;
+        if (journalOutstandingAIOsHigh < journalOutstandingAIOs)
+            journalOutstandingAIOsHigh = journalOutstandingAIOs;
+        instChanged = true;
+    }
+    inline void dec_journalOutstandingAIOs (uint32_t by = 1){
+        sys::RWlock::ScopedWlock writeLock (accessLock);
+        journalOutstandingAIOs -= by;
+        if (journalOutstandingAIOsLow > journalOutstandingAIOs)
+            journalOutstandingAIOsLow = journalOutstandingAIOs;
+        instChanged = true;
+    }
     inline void inc_journalFreeFileCount (uint32_t by = 1){
         sys::RWlock::ScopedWlock writeLock (accessLock);
         journalFreeFileCount += by;

Modified: store/trunk/cpp/lib/jrnl/jcntl.hpp
===================================================================
--- store/trunk/cpp/lib/jrnl/jcntl.hpp	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/jrnl/jcntl.hpp	2008-04-08 20:25:24 UTC (rev 1871)
@@ -598,8 +598,12 @@
         void chk_wr_frot();
         inline u_int32_t unflushed_dblks() { return _wmgr.unflushed_dblks(); }
 
+        // Management instrumentation callbacks
+        inline void instr_incr_outstanding_aio_cnt() {}
+        inline void instr_decr_outstanding_aio_cnt() {}
 
 
+
     protected:
         /**
         * \brief Check status of journal before allowing write operations.

Modified: store/trunk/cpp/lib/jrnl/wmgr.cpp
===================================================================
--- store/trunk/cpp/lib/jrnl/wmgr.cpp	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/cpp/lib/jrnl/wmgr.cpp	2008-04-08 20:25:24 UTC (rev 1871)
@@ -726,6 +726,7 @@
             _wrfc.incr_aio_cnt();
             _aio_evt_rem++;
             _cached_offset_dblks = 0;
+            _jc->instr_incr_outstanding_aio_cnt();
 
            rotate_page(); // increments _pg_index, resets _pg_offset_dblks if req'd
            if (_page_cb_arr[_pg_index]._state == UNUSED)
@@ -868,6 +869,7 @@
             // Use stored pointer to nlfh in the pcb instead.
             pcbp->_wfh->add_wr_cmpl_cnt_dblks(pcbp->_wdblks);
             pcbp->_wfh->decr_aio_cnt();
+            _jc->instr_decr_outstanding_aio_cnt();
 
             // Clean up this pcb's data_tok list
             pcbp->_pdtokl->clear();

Modified: store/trunk/specs/management-schema.xml
===================================================================
--- store/trunk/specs/management-schema.xml	2008-04-08 19:48:21 UTC (rev 1870)
+++ store/trunk/specs/management-schema.xml	2008-04-08 20:25:24 UTC (rev 1871)
@@ -26,6 +26,7 @@
     <instElement name="journalRecordDepth"         type="hilo32"  unit="record" desc="Number of enqueued records (durable messages)"/>
     <instElement name="journalRecordEnqueues"      type="count64" unit="record" desc="Total enqueued records on journal"/>
     <instElement name="journalRecordDequeues"      type="count64" unit="record" desc="Total dequeued records on journal"/>
+    <instElement name="journalOutstandingAIOs"     type="hilo32"  unit="record" desc="Number of outstanding AIO requests in Async IO system"/>
 
 <!--
     The following are not yet "wired up" in JournalImpl.cpp




More information about the rhmessaging-commits mailing list