Author: asoldano
Date: 2013-12-13 04:57:24 -0500 (Fri, 13 Dec 2013)
New Revision: 18176
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java
Log:
[JBWS-3747] Use System.nanoTime() instead of System.currentTimeMillis()
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java
===================================================================
---
common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java 2013-12-12
17:46:21 UTC (rev 18175)
+++
common/trunk/src/main/java/org/jboss/ws/common/management/EndpointMetricsImpl.java 2013-12-13
09:57:24 UTC (rev 18176)
@@ -71,13 +71,13 @@
return 0;
}
requestCount.incrementAndGet();
- return System.currentTimeMillis();
+ return System.nanoTime();
}
public void processResponseMessage(long beginTime)
{
if (beginTime > 0) {
- final long procTime = System.currentTimeMillis() - beginTime;
+ final long procTime = System.nanoTime() - beginTime;
r.lock();
try {
responseCount.incrementAndGet();
@@ -94,7 +94,7 @@
public void processFaultMessage(long beginTime)
{
if (beginTime > 0) {
- final long procTime = System.currentTimeMillis() - beginTime;
+ final long procTime = System.nanoTime() - beginTime;
r.lock();
try {
faultCount.incrementAndGet();
@@ -132,12 +132,12 @@
public long getMinProcessingTime()
{
- return minProcessingTime.longValue();
+ return minProcessingTime.longValue() / 1000000;
}
public long getMaxProcessingTime()
{
- return maxProcessingTime.longValue();
+ return maxProcessingTime.longValue() / 1000000;
}
public long getAverageProcessingTime()
@@ -145,7 +145,7 @@
w.lock();
try {
final long totResponses = responseCount.get() + faultCount.get();
- return totResponses != 0 ? totalProcessingTime.get() / totResponses : 0;
+ return totResponses != 0 ? totalProcessingTime.get() / (totResponses * 1000000)
: 0;
} finally {
w.unlock();
}
@@ -153,7 +153,7 @@
public long getTotalProcessingTime()
{
- return totalProcessingTime.get();
+ return totalProcessingTime.get() / 1000000;
}
public long getRequestCount()
Show replies by date