aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-06-27 14:57:43 +0000
committerOlivier Lamy <olamy@apache.org>2012-06-27 14:57:43 +0000
commitdead89634c36fccefa43c3715af351369cf81772 (patch)
tree5309cfd6b6349d157efb201f4eb2e8d4655f376c /archiva-modules
parent56fb96f87e126756061e730924e3b6c7fcf743bc (diff)
downloadarchiva-dead89634c36fccefa43c3715af351369cf81772.tar.gz
archiva-dead89634c36fccefa43c3715af351369cf81772.zip
display inMemorySize for cache
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1354560 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java18
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java4
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js5
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html2
4 files changed, 24 insertions, 5 deletions
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
index 74e1e252a..7020a0f39 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
@@ -39,18 +39,21 @@ public class CacheEntry
private String cacheHitRate;
+ private long inMemorySize;
+
public CacheEntry()
{
// no op
}
- public CacheEntry( String key, long size, long cacheHits, long cacheMiss, String cacheHitRate )
+ public CacheEntry( String key, long size, long cacheHits, long cacheMiss, String cacheHitRate, long inMemorySize )
{
this.key = key;
this.size = size;
this.cacheHits = cacheHits;
this.cacheMiss = cacheMiss;
this.cacheHitRate = cacheHitRate;
+ this.inMemorySize = inMemorySize;
}
public String getKey()
@@ -103,6 +106,16 @@ public class CacheEntry
this.cacheHitRate = cacheHitRate;
}
+ public long getInMemorySize()
+ {
+ return inMemorySize;
+ }
+
+ public void setInMemorySize( long inMemorySize )
+ {
+ this.inMemorySize = inMemorySize;
+ }
+
@Override
public String toString()
{
@@ -112,7 +125,8 @@ public class CacheEntry
sb.append( ", size=" ).append( size );
sb.append( ", cacheHits=" ).append( cacheHits );
sb.append( ", cacheMiss=" ).append( cacheMiss );
- sb.append( ", cacheHitRate=" ).append( cacheHitRate );
+ sb.append( ", cacheHitRate='" ).append( cacheHitRate ).append( '\'' );
+ sb.append( ", inMemorySize=" ).append( inMemorySize );
sb.append( '}' );
return sb.toString();
}
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
index e4f78b111..cb135a999 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
@@ -127,9 +127,11 @@ public class DefaultSystemStatusService
for ( Map.Entry<String, Cache> entry : caches.entrySet() )
{
CacheStatistics cacheStatistics = entry.getValue().getStatistics();
+
cacheEntries.add( new CacheEntry( entry.getKey(), cacheStatistics.getSize(), cacheStatistics.getCacheHits(),
cacheStatistics.getCacheMiss(),
- decimalFormat.format( cacheStatistics.getCacheHitRate() ).toString() ) );
+ decimalFormat.format( cacheStatistics.getCacheHitRate() ).toString(),
+ cacheStatistics.getInMemorySize() ) );
}
return cacheEntries;
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
index 2ac80163d..055f7195b 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
@@ -626,18 +626,19 @@ define("archiva.general-admin",["jquery","i18n","order!utils","order!jquery.tmpl
return [];
}
- CacheEntry=function(key,size,cacheHits,cacheMiss,cacheHitRate){
+ CacheEntry=function(key,size,cacheHits,cacheMiss,cacheHitRate,inMemorySize){
this.key=key;
this.size=size;
this.cacheHits=cacheHits;
this.cacheMiss=cacheMiss;
this.cacheHitRate=cacheHitRate;
+ this.inMemorySize=inMemorySize;
}
mapCacheEntries=function(data){
if(data!=null){
return $.map(data,function(item){
- return new CacheEntry(item.key,item.size,item.cacheHits,item.cacheMiss,item.cacheHitRate);
+ return new CacheEntry(item.key,item.size,item.cacheHits,item.cacheMiss,item.cacheHitRate,item.inMemorySize);
})
}
return [];
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html
index f85739b6a..6a2d17aa7 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html
@@ -396,6 +396,7 @@
<th>${$.i18n.prop('system-status.caches.grid.header.cacheHits')}</th>
<th>${$.i18n.prop('system-status.caches.grid.header.cacheMiss')}</th>
<th>${$.i18n.prop('system-status.caches.grid.header.cacheHitRate')}</th>
+ <th>${$.i18n.prop('system-status.caches.grid.header.inMemorySize')}</th>
<th>${$.i18n.prop('system-status.caches.grid.header.flush')}</th>
</tr>
</thead>
@@ -407,6 +408,7 @@
<td>${cacheEntry.cacheHits}</td>
<td>${cacheEntry.cacheMiss}</td>
<td>${cacheEntry.cacheHitRate}</td>
+ <td>${cacheEntry.inMemorySize}</td>
<td>
<a href="#" onclick="flushCache('${cacheEntry.key}')">
{{if cacheEntry.size > 0 }}