Skip to content

Commit adb0f6f

Browse files
committed
Remove the PstmtCache putCount as its just hitCount + missCount
So we can remove this as it is a redundant metric
1 parent 2d7d692 commit adb0f6f

File tree

2 files changed

+2
-15
lines changed

2 files changed

+2
-15
lines changed

ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ interface Heartbeat {
9999
private final long leakTimeMinutes;
100100
private final LongAdder pscHit = new LongAdder();
101101
private final LongAdder pscMiss = new LongAdder();
102-
private final LongAdder pscPut = new LongAdder();
103102
private final LongAdder pscRem = new LongAdder();
104103

105104
private final boolean shutdownOnJvmExit;
@@ -165,7 +164,6 @@ private void init() {
165164
void pstmtCacheMetrics(PstmtCache pstmtCache) {
166165
pscHit.add(pstmtCache.hitCount());
167166
pscMiss.add(pstmtCache.missCount());
168-
pscPut.add(pstmtCache.putCount());
169167
pscRem.add(pstmtCache.removeCount());
170168
}
171169

@@ -686,9 +684,9 @@ private void shutdownPool(boolean fullShutdown, boolean fromHook) {
686684
shutdownExecutor();
687685
}
688686
if (fromHook) {
689-
Log.info("DataSource [{0}] shutdown on JVM exit {1} psc[hit:{2} miss:{3} put:{4} rem:{5}]", name, status, pscHit, pscMiss, pscPut, pscRem);
687+
Log.info("DataSource [{0}] shutdown on JVM exit {1} psc[hit:{2} miss:{3} rem:{4}]", name, status, pscHit, pscMiss, pscRem);
690688
} else {
691-
Log.info("DataSource [{0}] shutdown {1} psc[hit:{2} miss:{3} put:{4} rem:{5}]", name, status, pscHit, pscMiss, pscPut, pscRem);
689+
Log.info("DataSource [{0}] shutdown {1} psc[hit:{2} miss:{3} rem:{4}]", name, status, pscHit, pscMiss, pscRem);
692690
removeShutdownHook();
693691
}
694692
} finally {

ebean-datasource/src/main/java/io/ebean/datasource/pool/PstmtCache.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ final class PstmtCache extends LinkedHashMap<String, ExtendedPreparedStatement>
1515
private long removeCount;
1616
private long hitCount;
1717
private long missCount;
18-
private long putCount;
1918

2019
PstmtCache(int maxCacheSize) {
2120
// note = access ordered list. This is what gives it the LRU order
@@ -53,10 +52,6 @@ long removeCount() {
5352
return removeCount;
5453
}
5554

56-
long putCount() {
57-
return putCount;
58-
}
59-
6055
/**
6156
* Try to add the returning statement to the cache. If there is already a
6257
* matching ExtendedPreparedStatement in the cache return false else add
@@ -105,12 +100,6 @@ public ExtendedPreparedStatement remove(Object key) {
105100
return o;
106101
}
107102

108-
@Override
109-
public ExtendedPreparedStatement put(String key, ExtendedPreparedStatement value) {
110-
putCount++;
111-
return super.put(key, value);
112-
}
113-
114103
@Override
115104
protected boolean removeEldestEntry(Map.Entry<String, ExtendedPreparedStatement> eldest) {
116105
if (size() < maxSize) {

0 commit comments

Comments
 (0)