directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvermill...@apache.org
Subject svn commit: r441036 - in /directory/sandbox/jvermillard/jmx/src/org/apache/mina: integration/jmx/IoServiceManager.java integration/jmx/IoSessionManager.java management/ management/IoSessionStats.java management/StatCollector.java stats/
Date Thu, 07 Sep 2006 09:50:48 GMT
Author: jvermillard
Date: Thu Sep  7 02:50:48 2006
New Revision: 441036

URL: http://svn.apache.org/viewvc?view=rev&rev=441036
Log:
reorganized packages + more javadoc

Added:
    directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/
      - copied from r440334, directory/sandbox/jvermillard/jmx/src/org/apache/mina/stats/
    directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/IoSessionStats.java
Removed:
    directory/sandbox/jvermillard/jmx/src/org/apache/mina/stats/
Modified:
    directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoServiceManager.java
    directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoSessionManager.java
    directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/StatCollector.java

Modified: directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoServiceManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoServiceManager.java?view=diff&rev=441036&r1=441035&r2=441036
==============================================================================
--- directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoServiceManager.java
(original)
+++ directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoServiceManager.java
Thu Sep  7 02:50:48 2006
@@ -28,7 +28,8 @@
 import org.apache.mina.common.IoServiceConfig;
 import org.apache.mina.common.IoServiceListener;
 import org.apache.mina.common.IoSession;
-import org.apache.mina.stats.StatCollector;
+import org.apache.mina.management.IoSessionStats;
+import org.apache.mina.management.StatCollector;
 
 
 /**
@@ -92,7 +93,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getByteReadThroughput();
             }
         }
@@ -110,7 +111,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getByteWrittenThroughput();
             }
         }
@@ -128,7 +129,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getMessageReadThroughput();
             }
         }
@@ -146,7 +147,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getMessageWrittenThroughput();
             }
         }
@@ -165,7 +166,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getByteReadThroughput();
                 count++;
             }
@@ -185,7 +186,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getByteWrittenThroughput();
                 count++;
             }
@@ -205,7 +206,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getMessageReadThroughput();
                 count++;
             }
@@ -225,7 +226,7 @@
             for ( Iterator iter2 = service.getManagedSessions( element ).iterator(); iter2.hasNext();
)
             {
                 IoSession session = ( IoSession ) iter2.next();
-                total += ( ( StatCollector.IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
+                total += ( ( IoSessionStats ) session.getAttribute( StatCollector.STAT_ID
) )
                     .getMessageWrittenThroughput();
                 count++;
             }

Modified: directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoSessionManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoSessionManager.java?view=diff&rev=441036&r1=441035&r2=441036
==============================================================================
--- directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoSessionManager.java
(original)
+++ directory/sandbox/jvermillard/jmx/src/org/apache/mina/integration/jmx/IoSessionManager.java
Thu Sep  7 02:50:48 2006
@@ -29,8 +29,8 @@
 import org.apache.mina.common.IoSession;
 import org.apache.mina.common.support.BaseIoSession;
 import org.apache.mina.filter.LoggingFilter;
-import org.apache.mina.stats.StatCollector;
-import org.apache.mina.stats.StatCollector.IoSessionStats;
+import org.apache.mina.management.IoSessionStats;
+import org.apache.mina.management.StatCollector;
 
 
 /**

Added: directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/IoSessionStats.java
URL: http://svn.apache.org/viewvc/directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/IoSessionStats.java?view=auto&rev=441036
==============================================================================
--- directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/IoSessionStats.java (added)
+++ directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/IoSessionStats.java Thu
Sep  7 02:50:48 2006
@@ -0,0 +1,108 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.mina.management;
+
+/**
+ * @author The Apache Directory Project (mina-dev@directory.apache.org)
+ * The collected stats for a session. It's used by StatCollector for attach throughput stats
to IoSession
+ */
+public class IoSessionStats
+{
+
+    long lastByteRead = -1;
+    long lastByteWrite = -1;
+    long lastMessageRead = -1;
+    long lastMessageWrite = -1;
+
+    float byteWrittenThroughput = 0;
+    float byteReadThroughput = 0;
+
+    float messageWrittenThroughput = 0;
+    float messageReadThroughput = 0;
+
+    /**
+     * Bytes read per second  
+     * @return bytes per second
+     */
+    public float getByteReadThroughput()
+    {
+        return byteReadThroughput;
+    }
+
+
+    /**
+     * Bytes written per second  
+     * @return bytes per second
+     */
+    public float getByteWrittenThroughput()
+    {
+        return byteWrittenThroughput;
+    }
+
+    /**
+     * Messages read per second  
+     * @return messages per second
+     */
+    public float getMessageReadThroughput()
+    {
+        return messageReadThroughput;
+    }
+
+    /**
+     * Messages written per second  
+     * @return messages per second
+     */
+    public float getMessageWrittenThroughput()
+    {
+        return messageWrittenThroughput;
+    }
+    
+    /**
+     * used for the StatCollector, last polling value 
+     */
+    long getLastByteRead()
+    {
+        return lastByteRead;
+    }
+
+    /**
+     * used for the StatCollector, last polling value 
+     */
+    long getLastByteWrite()
+    {
+        return lastByteWrite;
+    }
+
+    /**
+     * used for the StatCollector, last polling value 
+     */
+    long getLastMessageRead()
+    {
+        return lastMessageRead;
+    }
+
+    /**
+     * used for the StatCollector, last polling value 
+     */
+    long getLastMessageWrite()
+    {
+        return lastMessageWrite;
+    }
+}
\ No newline at end of file

Modified: directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/StatCollector.java
URL: http://svn.apache.org/viewvc/directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/StatCollector.java?view=diff&rev=441036&r1=440334&r2=441036
==============================================================================
--- directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/StatCollector.java (original)
+++ directory/sandbox/jvermillard/jmx/src/org/apache/mina/management/StatCollector.java Thu
Sep  7 02:50:48 2006
@@ -17,7 +17,7 @@
  *  under the License. 
  *  
  */
-package org.apache.mina.stats;
+package org.apache.mina.management;
 
 
 import java.net.SocketAddress;
@@ -33,6 +33,8 @@
 
 /**
  * @author The Apache Directory Project (mina-dev@directory.apache.org)
+ * An  IoService statistic collector. It's polling all the sessions of a given IoService.
It's attaching a IoSessionStats object to
+ * all the sessions polled and filling the throughput values.
  */
 public class StatCollector
 {
@@ -227,72 +229,6 @@
                 }
 
             }
-        }
-    }
-
-    /**
-     * the collected stats for a session.
-     */
-    public class IoSessionStats
-    {
-
-        long lastByteRead = -1;
-        long lastByteWrite = -1;
-        long lastMessageRead = -1;
-        long lastMessageWrite = -1;
-
-        float byteWrittenThroughput = 0;
-        float byteReadThroughput = 0;
-
-        float messageWrittenThroughput = 0;
-        float messageReadThroughput = 0;
-
-
-        public float getByteReadThroughput()
-        {
-            return byteReadThroughput;
-        }
-
-
-        public float getByteWrittenThroughput()
-        {
-            return byteWrittenThroughput;
-        }
-
-
-        public long getLastByteRead()
-        {
-            return lastByteRead;
-        }
-
-
-        public long getLastByteWrite()
-        {
-            return lastByteWrite;
-        }
-
-
-        public long getLastMessageRead()
-        {
-            return lastMessageRead;
-        }
-
-
-        public long getLastMessageWrite()
-        {
-            return lastMessageWrite;
-        }
-
-
-        public float getMessageReadThroughput()
-        {
-            return messageReadThroughput;
-        }
-
-
-        public float getMessageWrittenThroughput()
-        {
-            return messageWrittenThroughput;
         }
     }
 



Mime
View raw message