added code to measure read from db

This commit is contained in:
2014-09-02 18:12:10 +02:00
parent 72e120a63c
commit 3ffada8717

View File

@@ -123,6 +123,7 @@ public class CacheServiceImpl implements CacheService {
@Override @Override
public List<Cache> getAllCaches(CacheSortField sortField, SortDirection direction) { public List<Cache> getAllCaches(CacheSortField sortField, SortDirection direction) {
long start = System.currentTimeMillis();
List<Cache> caches = new ArrayList<>(); List<Cache> caches = new ArrayList<>();
try { try {
OObjectDatabaseTx database = dbService.getDatabase(); OObjectDatabaseTx database = dbService.getDatabase();
@@ -134,6 +135,8 @@ public class CacheServiceImpl implements CacheService {
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
long end = System.currentTimeMillis();
System.out.println("Load all caches ("+caches.size()+"): "+(end-start));
return caches; return caches;
} }