Author: olamy
Date: Wed Jun 27 14:57:43 2012
New Revision: 1354560

URL: http://svn.apache.org/viewvc?rev=1354560&view=rev
Log:
display inMemorySize for cache

Modified:
    
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
    
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java?rev=1354560&r1=1354559&r2=1354560&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/CacheEntry.java
 Wed Jun 27 14:57:43 2012
@@ -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();
     }

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java?rev=1354560&r1=1354559&r2=1354560&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultSystemStatusService.java
 Wed Jun 27 14:57:43 2012
@@ -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;

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js?rev=1354560&r1=1354559&r2=1354560&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
 Wed Jun 27 14:57:43 2012
@@ -626,18 +626,19 @@ define("archiva.general-admin",["jquery"
     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 [];

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html?rev=1354560&r1=1354559&r2=1354560&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/general-admin.html
 Wed Jun 27 14:57:43 2012
@@ -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 }}


Reply via email to