[infinispan-commits] Infinispan SVN: r1220 - in trunk: tools/src/main/java/org/infinispan/tools/jopr and 1 other directory.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Wed Nov 25 10:02:30 EST 2009


Author: galder.zamarreno at jboss.com
Date: 2009-11-25 10:02:30 -0500 (Wed, 25 Nov 2009)
New Revision: 1220

Modified:
   trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml
   trunk/tools/src/main/java/org/infinispan/tools/jopr/RhqPluginXmlGenerator.java
Log:
[ISPN-291] (Jopr operation returns are not shown) Fixed.

Modified: trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml	2009-11-25 09:22:21 UTC (rev 1219)
+++ trunk/jopr-plugin/src/main/resources/META-INF/rhq-plugin.xml	2009-11-25 15:02:30 UTC (rev 1220)
@@ -28,11 +28,17 @@
             </plugin-configuration>
 
            <operation name="getCache" displayName="Starts the default cache." description="Retrieves the default cache associated with this cache manager and starts it up.">
+              <results>
+                 <c:simple-property name="operationResult" />
+              </results>
            </operation>
            <operation name="getCacheWithCacheName" displayName="Starts a cache with the given name." description="Retrieves a named cache from the system and starts it up.">
               <parameters>
                  <c:simple-property name="cacheName" description="Name of cache to start"/>
               </parameters>
+              <results>
+                 <c:simple-property name="operationResult" />
+              </results>
            </operation>
 
            <metric property="Name" displayName="Cache manager name" displayType="summary" units="none" dataType="trait"
@@ -61,25 +67,44 @@
           >
 
 
-           <operation name="Passivation.resetStatistics" displayName="[Passivation] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="CacheLoader.resetStatistics" displayName="[CacheLoader] Reset Statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="Statistics.resetStatistics" displayName="[Statistics] Reset Statistics (Statistics)" description="Resets statistics gathered by this component">
-           </operation>
            <operation name="Activation.resetStatistics" displayName="[Activation] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="Invalidation.resetStatistics" displayName="[Invalidation] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="DistributionManager.isAffectedByRehash" displayName="[DistributionManager] Could key be affected by reshah?" description="Determines whether a given key is affected by an ongoing rehash, if any.">
+              <parameters>
+                 <c:simple-property name="key" description="Key to check"/>
+              </parameters>
+              <results>
+                 <c:simple-property name="operationResult" />
+              </results>
            </operation>
-           <operation name="Invalidation.setStatisticsEnabled" displayName="[Invalidation] Enable/disable statistics" description="Enable/disable statistics">
+           <operation name="DistributionManager.isLocatedLocally" displayName="[DistributionManager] Is key local?" description="Tells you whether a given key is local to this instance of the cache.  Only works with String keys.">
               <parameters>
-                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
+                 <c:simple-property name="key" description="Key to query"/>
               </parameters>
+              <results>
+                 <c:simple-property name="operationResult" />
+              </results>
            </operation>
-           <operation name="CacheStore.resetStatistics" displayName="[CacheStore] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="DistributionManager.locateKey" displayName="[DistributionManager] Locate key" description="Locates an object in a cluster.  Only works with String keys.">
+              <parameters>
+                 <c:simple-property name="key" description="Key to locate"/>
+              </parameters>
+              <results>
+                 <c:simple-property name="operationResult" />
+              </results>
            </operation>
-           <operation name="CacheLoader.resetStatistics" displayName="[CacheLoader] Reset Statistics" description="Resets statistics gathered by this component">
+           <operation name="Statistics.resetStatistics" displayName="[Statistics] Reset Statistics (Statistics)" description="Resets statistics gathered by this component">
            </operation>
            <operation name="DeadlockDetectingLockManager.resetStatistics" displayName="[DeadlockDetectingLockManager] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
+           <operation name="Cache.start" displayName="[Cache] Starts cache." description="Starts the cache.">
+           </operation>
+           <operation name="Cache.stop" displayName="[Cache] Stops cache." description="Stops the cache.">
+           </operation>
+           <operation name="Passivation.resetStatistics" displayName="[Passivation] Reset statistics" description="Resets statistics gathered by this component">
+           </operation>
            <operation name="Transactions.resetStatistics" displayName="[Transactions] Reset Statistics" description="Resets statistics gathered by this component">
            </operation>
            <operation name="Transactions.setStatisticsEnabled" displayName="[Transactions] Enable/disable statistics" description="Enable/disable statistics">
@@ -87,35 +112,37 @@
                  <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
               </parameters>
            </operation>
-           <operation name="DistributionManager.isAffectedByRehash" displayName="[DistributionManager] Could key be affected by reshah?" description="Determines whether a given key is affected by an ongoing rehash, if any.">
-              <parameters>
-                 <c:simple-property name="key" description="Key to check"/>
-              </parameters>
+           <operation name="CacheStore.resetStatistics" displayName="[CacheStore] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="DistributionManager.isLocatedLocally" displayName="[DistributionManager] Is key local?" description="Tells you whether a given key is local to this instance of the cache.  Only works with String keys.">
-              <parameters>
-                 <c:simple-property name="key" description="Key to query"/>
-              </parameters>
+           <operation name="RpcManager.resetStatistics" displayName="[RpcManager] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="DistributionManager.locateKey" displayName="[DistributionManager] Locate key" description="Locates an object in a cluster.  Only works with String keys.">
+           <operation name="RpcManager.setStatisticsEnabled" displayName="[RpcManager] Enable/disable statistics" description="Enable/disable statistics">
               <parameters>
-                 <c:simple-property name="key" description="Key to locate"/>
+                 <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
               </parameters>
            </operation>
-           <operation name="RpcManager.resetStatistics" displayName="[RpcManager] Reset statistics" description="Resets statistics gathered by this component">
+           <operation name="Invalidation.resetStatistics" displayName="[Invalidation] Reset statistics" description="Resets statistics gathered by this component">
            </operation>
-           <operation name="RpcManager.setStatisticsEnabled" displayName="[RpcManager] Enable/disable statistics" description="Enable/disable statistics">
+           <operation name="Invalidation.setStatisticsEnabled" displayName="[Invalidation] Enable/disable statistics" description="Enable/disable statistics">
               <parameters>
                  <c:simple-property name="enabled" description="Whether statistics should be enabled or disabled (true/false)"/>
               </parameters>
            </operation>
-           <operation name="Cache.start" displayName="[Cache] Starts cache." description="Starts the cache.">
-           </operation>
-           <operation name="Cache.stop" displayName="[Cache] Stops cache." description="Stops the cache.">
-           </operation>
 
-           <metric property="Passivation.Passivations" displayName="[Passivation] Number of cache passivations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of passivation events" />
+           <metric property="CacheLoader.CacheLoaderLoads" displayName="[CacheLoader] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries loaded from cache store" />
+           <metric property="CacheLoader.CacheLoaderMisses" displayName="[CacheLoader] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries that did not exist in cache store" />
+           <metric property="Activation.Activations" displayName="[Activation] Number of cache entries activated" displayType="detail" units="none" dataType="measurement"
+                   description="Number of activation events" />
+           <metric property="Activation.CacheLoaderLoads" displayName="[Activation] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries loaded from cache store" />
+           <metric property="Activation.CacheLoaderMisses" displayName="[Activation] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
+                   description="Number of entries that did not exist in cache store" />
+           <metric property="DistributionManager.RehashInProgress" displayName="[DistributionManager] Is rehash in progress?" displayType="detail" units="none" dataType="trait"
+                   description="Checks whether the node is involved in a rehash." />
+           <metric property="DistributionManager.JoinComplete" displayName="[DistributionManager] Is join completed?" displayType="detail" units="none" dataType="trait"
+                   description="If true, the node has successfully joined the grid and is considered to hold state.  If false, the join process is still in progress." />
            <metric property="Statistics.Stores" displayName="[Statistics] Number of cache puts" displayType="summary" units="none" dataType="measurement"
                    description="number of cache attribute put operations" />
            <metric property="Statistics.Hits" displayName="[Statistics] Number of cache hits" displayType="summary" units="none" dataType="measurement"
@@ -138,28 +165,6 @@
                    description="Number of seconds since cache started" />
            <metric property="Statistics.TimeSinceReset" displayName="[Statistics] Seconds since cache statistics were reset" displayType="summary" units="seconds" dataType="measurement"
                    description="Number of seconds since the cache statistics were last reset" />
-           <metric property="Activation.Activations" displayName="[Activation] Number of cache entries activated" displayType="detail" units="none" dataType="measurement"
-                   description="Number of activation events" />
-           <metric property="Activation.CacheLoaderLoads" displayName="[Activation] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries loaded from cache store" />
-           <metric property="Activation.CacheLoaderMisses" displayName="[Activation] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries that did not exist in cache store" />
-           <metric property="Invalidation.StatisticsEnabled" displayName="[Invalidation] Statistics enabled" displayType="detail" units="none" dataType="trait"
-                   description="Statistics enabled" />
-           <metric property="Invalidation.Invalidations" displayName="[Invalidation] Number of invalidations" displayType="detail" units="none" dataType="measurement"
-                   description="Number of invalidations" />
-           <metric property="LockManager.ConcurrencyLevel" displayName="[LockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
-                   description="The concurrency level that the MVCC Lock Manager has been configured with." />
-           <metric property="LockManager.NumberOfLocksHeld" displayName="[LockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
-                   description="The number of exclusive locks that are held." />
-           <metric property="LockManager.NumberOfLocksAvailable" displayName="[LockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
-                   description="The number of exclusive locks that are available." />
-           <metric property="CacheStore.CacheLoaderStores" displayName="[CacheStore] Number of cache stores" displayType="detail" units="none" dataType="measurement"
-                   description="number of cache loader stores" />
-           <metric property="CacheLoader.CacheLoaderLoads" displayName="[CacheLoader] Number of cache store loads" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries loaded from cache store" />
-           <metric property="CacheLoader.CacheLoaderMisses" displayName="[CacheLoader] Number of cache store load misses" displayType="detail" units="none" dataType="measurement"
-                   description="Number of entries that did not exist in cache store" />
            <metric property="DeadlockDetectingLockManager.OverlapWithNotDeadlockAwareLockOwners" displayName="[DeadlockDetectingLockManager] Number of unsolvable deadlock situations" displayType="detail" units="none" dataType="measurement"
                    description="Number of situtations when we try to determine a deadlock and the other lock owner is e.g. a local tx. In this scenario we cannot run the deadlock detection mechanism" />
            <metric property="DeadlockDetectingLockManager.LocallyInterruptedTransactions" displayName="[DeadlockDetectingLockManager] Number of interrupted local transactions" displayType="detail" units="none" dataType="measurement"
@@ -176,6 +181,12 @@
                    description="The number of exclusive locks that are held." />
            <metric property="DeadlockDetectingLockManager.NumberOfLocksAvailable" displayName="[DeadlockDetectingLockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
                    description="The number of exclusive locks that are available." />
+           <metric property="Cache.CacheName" displayName="[Cache] Cache name" displayType="summary" units="none" dataType="trait"
+                   description="Returns the cache name" />
+           <metric property="Cache.CacheStatus" displayName="[Cache] Cache status" displayType="summary" units="none" dataType="trait"
+                   description="Returns the cache status" />
+           <metric property="Passivation.Passivations" displayName="[Passivation] Number of cache passivations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of passivation events" />
            <metric property="Transactions.StatisticsEnabled" displayName="[Transactions] Statistics enabled" displayType="detail" units="none" dataType="trait"
                    description="Statistics enabled" />
            <metric property="Transactions.Prepares" displayName="[Transactions] Prepares" displayType="summary" units="none" dataType="measurement"
@@ -184,10 +195,8 @@
                    description="Number of transaction commits performed since last reset" />
            <metric property="Transactions.Rollbacks" displayName="[Transactions] Rollbacks" displayType="summary" units="none" dataType="measurement"
                    description="Number of transaction rollbacks performed since last reset" />
-           <metric property="DistributionManager.RehashInProgress" displayName="[DistributionManager] Is rehash in progress?" displayType="detail" units="none" dataType="trait"
-                   description="Checks whether the node is involved in a rehash." />
-           <metric property="DistributionManager.JoinComplete" displayName="[DistributionManager] Is join completed?" displayType="detail" units="none" dataType="trait"
-                   description="If true, the node has successfully joined the grid and is considered to hold state.  If false, the join process is still in progress." />
+           <metric property="CacheStore.CacheLoaderStores" displayName="[CacheStore] Number of cache stores" displayType="detail" units="none" dataType="measurement"
+                   description="number of cache loader stores" />
            <metric property="RpcManager.Address" displayName="[RpcManager] Network address" displayType="summary" units="none" dataType="trait"
                    description="The network address associated with this instance" />
            <metric property="RpcManager.Members" displayName="[RpcManager] Cluster members" displayType="summary" units="none" dataType="trait"
@@ -206,10 +215,16 @@
                    description="Successful replications as a ratio of total replications in numeric double format" />
            <metric property="RpcManager.AverageReplicationTime" displayName="[RpcManager] Average time spent in the transport layer" displayType="summary" units="milliseconds" dataType="measurement"
                    description="The average time spent in the transport layer, in milliseconds" />
-           <metric property="Cache.CacheName" displayName="[Cache] Cache name" displayType="summary" units="none" dataType="trait"
-                   description="Returns the cache name" />
-           <metric property="Cache.CacheStatus" displayName="[Cache] Cache status" displayType="summary" units="none" dataType="trait"
-                   description="Returns the cache status" />
+           <metric property="LockManager.ConcurrencyLevel" displayName="[LockManager] Concurrency level" displayType="detail" units="none" dataType="trait"
+                   description="The concurrency level that the MVCC Lock Manager has been configured with." />
+           <metric property="LockManager.NumberOfLocksHeld" displayName="[LockManager] Number of locks held" displayType="detail" units="none" dataType="measurement"
+                   description="The number of exclusive locks that are held." />
+           <metric property="LockManager.NumberOfLocksAvailable" displayName="[LockManager] Number of locks available" displayType="detail" units="none" dataType="measurement"
+                   description="The number of exclusive locks that are available." />
+           <metric property="Invalidation.StatisticsEnabled" displayName="[Invalidation] Statistics enabled" displayType="detail" units="none" dataType="trait"
+                   description="Statistics enabled" />
+           <metric property="Invalidation.Invalidations" displayName="[Invalidation] Number of invalidations" displayType="detail" units="none" dataType="measurement"
+                   description="Number of invalidations" />
 
 
        </service>

Modified: trunk/tools/src/main/java/org/infinispan/tools/jopr/RhqPluginXmlGenerator.java
===================================================================
--- trunk/tools/src/main/java/org/infinispan/tools/jopr/RhqPluginXmlGenerator.java	2009-11-25 09:22:21 UTC (rev 1219)
+++ trunk/tools/src/main/java/org/infinispan/tools/jopr/RhqPluginXmlGenerator.java	2009-11-25 15:02:30 UTC (rev 1220)
@@ -247,15 +247,20 @@
                      operation.getParams().add(new SimpleProperty("p" + i++));
                   }
                }
+               Class<?> returnType = method.getReturnType();
+               if (!returnType.equals(Void.TYPE)) {
+                  SimpleProperty prop = new SimpleProperty("operationResult");
+                  operation.setResult(prop);
+               }
                props.getOperations().add(operation);
             }
          }
          Field[] fields = clazz.getDeclaredFields();
          for (Field field : fields) {
-            System.out.println("Inspecting field " + field);
+            debug("Inspecting field " + field);
             Metric rhqMetric = field.getAnnotation(Metric.class);
             if (rhqMetric != null) {
-               System.out.println("Field " + field + " contains Metric annotation " + rhqMetric);
+               debug("Field " + field + " contains Metric annotation " + rhqMetric);
                String property = prefix + BeanConventions.getPropertyFromBeanConvention(field);
                if (!rhqMetric.property().isEmpty()) {
                   property = prefix + rhqMetric.property();



More information about the infinispan-commits mailing list