qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tr...@apache.org
Subject svn commit: r662592 - in /incubator/qpid/trunk/qpid: cpp/managementgen/schema.py cpp/managementgen/templates/Class.cpp specs/management-schema.xml
Date Mon, 02 Jun 2008 22:32:22 GMT
Author: tross
Date: Mon Jun  2 15:32:21 2008
New Revision: 662592

URL: http://svn.apache.org/viewvc?rev=662592&view=rev
Log:
Queue stats: byteDepth now computed periodically

Modified:
    incubator/qpid/trunk/qpid/cpp/managementgen/schema.py
    incubator/qpid/trunk/qpid/cpp/managementgen/templates/Class.cpp
    incubator/qpid/trunk/qpid/specs/management-schema.xml

Modified: incubator/qpid/trunk/qpid/cpp/managementgen/schema.py
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/managementgen/schema.py?rev=662592&r1=662591&r2=662592&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/managementgen/schema.py (original)
+++ incubator/qpid/trunk/qpid/cpp/managementgen/schema.py Mon Jun  2 15:32:21 2008
@@ -324,10 +324,11 @@
 #=====================================================================================
 class SchemaInst:
   def __init__ (self, node, typespec):
-    self.name = None
-    self.type = None
-    self.unit = None
-    self.desc = None
+    self.name   = None
+    self.type   = None
+    self.unit   = None
+    self.desc   = None
+    self.assign = None
 
     attrs = node.attributes
     for idx in range (attrs.length):
@@ -345,6 +346,9 @@
       elif key == 'desc':
         self.desc = val
         
+      elif key == 'assign':
+        self.assign = val
+        
       else:
         raise ValueError ("Unknown attribute in statistic '%s'" % key)
 
@@ -410,6 +414,10 @@
       self.genSchemaText (stream, self.name + "Max",     descMax)
       self.genSchemaText (stream, self.name + "Average", descAverage)
 
+  def genAssign (self, stream):
+    if self.assign != None:
+      stream.write ("    " + self.name + " = (" + self.type.type.cpp + ") (" + self.assign
+ ");\n")
+
   def genWrite (self, stream):
     self.type.type.genWrite (stream, self.name)
 
@@ -874,13 +882,17 @@
         stream.write (",")
       stream.write (hex (ord (sum[idx])))
 
+  def genAssign (self, stream, variables):
+    for inst in self.statistics:
+      inst.genAssign (stream)
+
   def genWriteConfig (self, stream, variables):
     for config in self.properties:
-      config.genWrite (stream);
+      config.genWrite (stream)
 
   def genWriteInst (self, stream, variables):
     for inst in self.statistics:
-      inst.genWrite (stream);
+      inst.genWrite (stream)
 
 
 

Modified: incubator/qpid/trunk/qpid/cpp/managementgen/templates/Class.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/managementgen/templates/Class.cpp?rev=662592&r1=662591&r2=662592&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/managementgen/templates/Class.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/managementgen/templates/Class.cpp Mon Jun  2 15:32:21 2008
@@ -98,6 +98,7 @@
 {
     sys::Mutex::ScopedLock mutex(accessLock);
     instChanged = false;
+/*MGEN:Class.Assign*/
 
     if (!skipHeaders)
         writeTimestamps (buf);

Modified: incubator/qpid/trunk/qpid/specs/management-schema.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/specs/management-schema.xml?rev=662592&r1=662591&r2=662592&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/specs/management-schema.xml (original)
+++ incubator/qpid/trunk/qpid/specs/management-schema.xml Mon Jun  2 15:32:21 2008
@@ -139,7 +139,8 @@
     <statistic name="msgPersistEnqueues"  type="count64"  unit="message"     desc="Persistent
messages enqueued"/>
     <statistic name="msgPersistDequeues"  type="count64"  unit="message"     desc="Persistent
messages dequeued"/>
     <statistic name="msgDepth"            type="atomic32" unit="message"     desc="Current
size of queue in messages"/>
-    <statistic name="byteDepth"           type="count32"  unit="octet"       desc="Current
size of queue in bytes"/>
+    <statistic name="byteDepth"           type="count32"  unit="octet"
+               assign="byteTotalEnqueues - byteTotalDequeues"                desc="Current
size of queue in bytes"/>
     <statistic name="byteTotalEnqueues"   type="count64"  unit="octet"       desc="Total
messages enqueued"/>
     <statistic name="byteTotalDequeues"   type="count64"  unit="octet"       desc="Total
messages dequeued"/>
     <statistic name="byteTxnEnqueues"     type="count64"  unit="octet"       desc="Transactional
messages enqueued"/>



Mime
View raw message