db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From be...@apache.org
Subject svn commit: r633845 - in /db/derby/code/trunk/java/drda/org/apache/derby: impl/drda/DDMWriter.java impl/drda/NetworkServerMBeanImpl.java mbeans/drda/NetworkServerMBean.java
Date Wed, 05 Mar 2008 13:49:44 GMT
Author: bernt
Date: Wed Mar  5 05:49:41 2008
New Revision: 633845

URL: http://svn.apache.org/viewvc?rev=633845&view=rev
Log:
DERBY-3435 Fixed precision, threading. Changed some attribute names

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java
    db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java?rev=633845&r1=633844&r2=633845&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DDMWriter.java Wed Mar  5 05:49:41
2008
@@ -1679,6 +1679,7 @@
 	final int length = buffer.position();
     try {
       socketOutputStream.write(bytes, 0, length);
+      totalByteCount += length;
       if(flashStream)
 	  socketOutputStream.flush();
     }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java?rev=633845&r1=633844&r2=633845&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java Wed
Mar  5 05:49:41 2008
@@ -208,19 +208,19 @@
     }
      **/
     
-    public int getActiveSessions() {
+    public int getActiveConnections() {
         return server.getActiveSessions();
     }
     
-    public int getWaitingSessions() {
+    public int getWaitingConnections() {
         return server.getRunQueueSize();
     }
     
-    public int getConnectionThreads() {
+    public int getConnectionThreadPoolSize() {
         return server.getThreadListSize();
     }
      
-    public int getNumberOfConnections() {
+    public int getConnectionCounter() {
         return server.getConnectionNumber();
     }
     
@@ -236,11 +236,11 @@
     private long lastReceiveBytes = 0;
     private int receiveResult = 0;
     
-    public int getBytesReceivedPerSecond(){
+    synchronized public int getBytesReceivedPerSecond(){
         long now = System.currentTimeMillis();
         if (now - lastReceiveTime >= 1000) {
             long count = getBytesReceived();
-            receiveResult = (int)((count - lastReceiveBytes)/((now - lastReceiveTime)/1000));
+            receiveResult = (int)((count - lastReceiveBytes) * 1000 /((now - lastReceiveTime)));
             lastReceiveTime = now;
             lastReceiveBytes = count;
         }
@@ -251,11 +251,11 @@
     private long lastSentBytes = 0;
     private int sentResult = 0;
 
-    public int getBytesSentPerSecond(){
+    synchronized public int getBytesSentPerSecond(){
         long now = System.currentTimeMillis();
         if (now - lastSentTime >= 1000) {
             long count = getBytesSent();
-            sentResult = (int)((count - lastSentBytes)/((now - lastSentTime)/1000));
+            sentResult = (int) ((count - lastSentBytes) * 1000 / (now - lastSentTime));
             lastSentTime = now;
             lastSentBytes = count;
         }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java?rev=633845&r1=633844&r2=633845&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java Wed
Mar  5 05:49:41 2008
@@ -141,25 +141,25 @@
      * Get the number of active sessions
      * @return number of active sessions
      */
-    public int getActiveSessions();
+    public int getActiveConnections();
     
     /**
      * get the number of waiting sessions. Always 0 if drdaMaxThreads is 0.
      * @return number of waiting sessions
      */
-    public int getWaitingSessions();
+    public int getWaitingConnections();
     
     /**
      * Get the size of the thread pool.
      * @return size of thread pool
      */
-    public int getConnectionThreads();
+    public int getConnectionThreadPoolSize();
     
     /**
      * Get the accumulated number of connections.
      * @return number of connections.
      */
-    public int getNumberOfConnections();
+    public int getConnectionCounter();
     
     /**
      * Get the total number of bytes read



Mime
View raw message