Author: adrianc
Date: Sat May 18 16:12:50 2013
New Revision: 1484134

URL: http://svn.apache.org/r1484134
Log:
Reverted revision 1483822.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/Metrics.java
    ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/MetricsFactory.java
    ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
    
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
    ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
    ofbiz/trunk/framework/webtools/widget/StatsForms.xml

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/Metrics.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/Metrics.java?rev=1484134&r1=1484133&r2=1484134&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/Metrics.java 
(original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/Metrics.java Sat May 
18 16:12:50 2013
@@ -53,12 +53,6 @@ public interface Metrics {
      */
     double getServiceRate();
 
-    /**
-     * Returns a moving average of the request rate in milliseconds. The 
default
-     * implementation divides the total time by the total number of events
-     */
-    double getRequestRate();
-
     /** Returns the metric threshold. The meaning of the threshold is
      * determined by client code.
      * <p>The idea is for client code to compare {@link #getServiceRate()} to
@@ -75,13 +69,6 @@ public interface Metrics {
      */
     void recordServiceRate(int numEvents, long time);
 
-    /** 
-     * Records the request time for <code>numEvents</code> taking
-     * <code>time</code> milliseconds to be processed.
-     */
-    void recordRequestRate(int numEvents, long time);
-
     /** Resets all metrics. */
     void reset();
-
 }
\ No newline at end of file

Modified: 
ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/MetricsFactory.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/MetricsFactory.java?rev=1484134&r1=1484133&r2=1484134&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/MetricsFactory.java 
(original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/metrics/MetricsFactory.java 
Sat May 18 16:12:50 2013
@@ -144,7 +144,6 @@ public final class MetricsFactory {
         private long lastTime = System.currentTimeMillis();
         @LockedBy("this")
         private double serviceRate = 0.0;
-        private double requestRate = 0.0;
         @LockedBy("this")
         private long totalServiceTime = 0;
         @LockedBy("this")
@@ -188,11 +187,6 @@ public final class MetricsFactory {
         }
 
         @Override
-        public synchronized double getRequestRate() {
-            return requestRate;
-        }
-
-        @Override
         public double getThreshold() {
             return threshold;
         }
@@ -226,17 +220,9 @@ public final class MetricsFactory {
             }
         }
 
-        public synchronized void recordRequestRate(int numEvents, long time) {
-            totalEvents += numEvents;
-            cumulativeEvents += numEvents;
-            totalServiceTime += time;
-            requestRate = totalServiceTime / cumulativeEvents;
-        }
-
         @Override
         public synchronized void reset() {
             serviceRate = 0.0;
-            requestRate = 0.0;
             count = 0;
             lastTime = System.currentTimeMillis();
             totalEvents = totalServiceTime = cumulativeEvents = 0;
@@ -261,11 +247,6 @@ public final class MetricsFactory {
         }
 
         @Override
-        public double getRequestRate() {
-            return 0;
-        }
-
-        @Override
         public double getThreshold() {
             return 0.0;
         }
@@ -280,10 +261,6 @@ public final class MetricsFactory {
         }
 
         @Override
-        public void recordRequestRate(int numEvents, long time) {
-        }
-
-        @Override
         public void reset() {
         }
     }

Modified: ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java?rev=1484134&r1=1484133&r2=1484134&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java 
(original)
+++ ofbiz/trunk/framework/common/src/org/ofbiz/common/CommonServices.java Sat 
May 18 16:12:50 2013
@@ -552,7 +552,6 @@ public class CommonServices {
             Map<String, Object> metricsMap = FastMap.newInstance();
             metricsMap.put("name", metrics.getName());
             metricsMap.put("serviceRate", metrics.getServiceRate());
-            metricsMap.put("requestRate", metrics.getRequestRate());
             metricsMap.put("threshold", metrics.getThreshold());
             metricsMap.put("totalEvents", metrics.getTotalEvents());
             metricsMapList.add(metricsMap);

Modified: 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java?rev=1484134&r1=1484133&r2=1484134&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java 
(original)
+++ 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/control/RequestHandler.java 
Sat May 18 16:12:50 2013
@@ -109,7 +109,6 @@ public class RequestHandler {
             GenericValue userLogin, Delegator delegator) throws 
RequestHandlerException, RequestHandlerExceptionAllowExternalRequests {
 
         long startTime = System.currentTimeMillis();
-        int numEvent = 1;
         HttpSession session = request.getSession();
 
         // get the controllerConfig once for this method so we don't have to 
get it over and over inside the method
@@ -422,11 +421,6 @@ public class RequestHandler {
                         ServerHitBin.countEvent(cname + "." + 
requestMap.event.invoke, request, eventStartTime,
                                 System.currentTimeMillis() - eventStartTime, 
userLogin);
                     }
-                    if (requestMap.metrics != null) {
-                        requestMap.metrics.recordRequestRate(numEvent, 
System.currentTimeMillis() - eventStartTime);
-                        numEvent = 0;
-                    }
-                    
 
                     // set the default event return
                     if (eventReturn == null) {
@@ -682,7 +676,7 @@ public class RequestHandler {
             }
         }
         if (requestMap.metrics != null) {
-            requestMap.metrics.recordServiceRate(numEvent, 
System.currentTimeMillis() - startTime);
+            requestMap.metrics.recordServiceRate(1, System.currentTimeMillis() 
- startTime);
         }
     }
 

Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml?rev=1484134&r1=1484133&r2=1484134&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml (original)
+++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml Sat May 18 
16:12:50 2013
@@ -3405,13 +3405,8 @@
         <value xml:lang="ja">メトリックス</value>
         <value xml:lang="zh">度量</value>
     </property>
-    <property key="WebtoolsMetricsRequestRate">
-        <value xml:lang="en">Request/Event Rate (mS)</value>
-        <value xml:lang="fr">Durée des requêtes/évènements (mS)</value>
-    </property>
-    <property key="WebtoolsMetricsServiceRate">
+    <property key="WebtoolsMetricsRate">
         <value xml:lang="en">Service Rate (mS)</value>
-        <value xml:lang="fr">Durée des Services (mS)</value>
         <value xml:lang="ja">サービスレート(ミリ秒)</value>
         <value xml:lang="zh">服务速率(毫秒)</value>
     </property>
@@ -5058,7 +5053,7 @@
     <property key="WebtoolsStatsNoRequests">
         <value xml:lang="de">Es wurden keine Anfragestatistiken 
gefunden.</value>
         <value xml:lang="en">No Request statistics found.</value>
-        <value xml:lang="fr">Aucune requête de statistiques trouvée</value>
+        <value xml:lang="fr">Aucune requêt de statistiques trouvée</value>
         <value xml:lang="it">Nessuna statistica delle request trovata.</value>
         <value xml:lang="ja">リクエスト統計はありません</value>
         <value xml:lang="pt">Nenhum pedido de estatísticas 
encontrado.</value>

Modified: ofbiz/trunk/framework/webtools/widget/StatsForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/StatsForms.xml?rev=1484134&r1=1484133&r2=1484134&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/StatsForms.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/StatsForms.xml Sat May 18 16:12:50 
2013
@@ -49,14 +49,13 @@ under the License.
     <form name="ListMetrics" type="list" list-name="metricsList" 
paginate-target="ViewMetrics"
             header-row-style="header-row-2" default-table-style="basic-table 
light-grid">
         <actions>
-            <service service-name="getAllMetrics" />
-        </actions>
-        <field name="name" title="${uiLabelMap.CommonName}"><display/></field>
-        <field name="serviceRate" 
title="${uiLabelMap.WebtoolsMetricsServiceRate}"><display/></field>
-        <field name="requestRate" 
title="${uiLabelMap.WebtoolsMetricsRequestRate}"><display/></field>
-        <field name="threshold" 
title="${uiLabelMap.WebtoolsMetricsThreshold}"><display/></field>
-        <field name="totalEvents" 
title="${uiLabelMap.WebtoolsMetricsTotalEvents}"><display/></field>
-        <field name="resetMetric" title=" " widget-area-style="button-col">
+            <service service-name="getAllMetrics" />
+        </actions>
+        <field name="name" title="${uiLabelMap.CommonName}"><display/></field>
+        <field name="serviceRate" 
title="${uiLabelMap.WebtoolsMetricsRate}"><display/></field>
+        <field name="threshold" 
title="${uiLabelMap.WebtoolsMetricsThreshold}"><display/></field>
+        <field name="totalEvents" 
title="${uiLabelMap.WebtoolsMetricsTotalEvents}"><display/></field>
+        <field name="resetMetric" title=" " widget-area-style="button-col">
             <hyperlink description="${uiLabelMap.CommonReset}" 
target="ResetMetric">
                 <parameter param-name="name"/>
             </hyperlink>


Reply via email to