geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject [geronimo-jcache-simple] branch master updated: fixing time based stats
Date Tue, 05 Jun 2018 07:46:44 GMT
This is an automated email from the ASF dual-hosted git repository.

rmannibucau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/geronimo-jcache-simple.git


The following commit(s) were added to refs/heads/master by this push:
     new 67a252d  fixing time based stats
67a252d is described below

commit 67a252d99736aeeb99eae5ac18d66e8cfffcdcdc
Author: Romain Manni-Bucau <rmannibucau@gmail.com>
AuthorDate: Tue Jun 5 09:46:36 2018 +0200

    fixing time based stats
---
 pom.xml                                                          | 2 +-
 src/main/java/org/apache/geronimo/jcache/simple/SimpleCache.java | 2 +-
 src/main/java/org/apache/geronimo/jcache/simple/Statistics.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 8ad58dd..547a3c4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -34,7 +34,7 @@
   <properties>
 
     <implementation-groupId>${project.groupId}</implementation-groupId>
-    <implementation-artifactId>commons-jcs</implementation-artifactId>
+    <implementation-artifactId>${project.artifactId}</implementation-artifactId>
     <implementation-version>${project.version}</implementation-version>
 
     <CacheManagerImpl>org.apache.geronimo.jcache.simple.SimpleManager</CacheManagerImpl>
diff --git a/src/main/java/org/apache/geronimo/jcache/simple/SimpleCache.java b/src/main/java/org/apache/geronimo/jcache/simple/SimpleCache.java
index 43e49b3..9788a16 100644
--- a/src/main/java/org/apache/geronimo/jcache/simple/SimpleCache.java
+++ b/src/main/java/org/apache/geronimo/jcache/simple/SimpleCache.java
@@ -273,7 +273,7 @@ public class SimpleCache<K, V> implements Cache<K, V> {
 
             if (statisticsEnabled) {
                 statistics.increasePuts(1);
-                statistics.addPutTime(System.currentTimeMillis() - start);
+                statistics.addPutTime(Times.now(false) - start);
             }
         } else {
             if (!created) {
diff --git a/src/main/java/org/apache/geronimo/jcache/simple/Statistics.java b/src/main/java/org/apache/geronimo/jcache/simple/Statistics.java
index 3247e2c..ffead32 100644
--- a/src/main/java/org/apache/geronimo/jcache/simple/Statistics.java
+++ b/src/main/java/org/apache/geronimo/jcache/simple/Statistics.java
@@ -113,7 +113,7 @@ public class Statistics {
             return;
         }
 
-        if (counter.get() < Long.MAX_VALUE - duration) {
+        if (counter.get() + duration < Long.MAX_VALUE) {
             counter.addAndGet(duration);
         } else {
             reset();

-- 
To stop receiving notification emails like this one, please contact
rmannibucau@apache.org.

Mime
View raw message