// Request
row = req.addRow();
req.setAt(KeyConstants._web, row, web.getLabel());
req.setAt(KeyConstants._uri, row, getPath(_pc.getHttpServletRequest()));
req.setAt(START_TIME, row, new DateTimeImpl(pc.getStartTime(),false));
req.setAt(KeyConstants._timeout, row, new Double(pc.getRequestTimeout()));
// Query
queries = _pc.getActiveQueries();
if(queries!=null) {
for(int y=0;y<queries.length;y++){
aq=queries[y];
row = qry.addRow();
qry.setAt(KeyConstants._web, row, web.getLabel());
qry.setAt(KeyConstants._application, row, _pc.getApplicationContext().getName());
qry.setAt(START_TIME, row, new DateTimeImpl(web,aq.startTime,true));
qry.setAt(KeyConstants._sql, row, aq.sql);
}
}
// Lock
locks = _pc.getActiveLocks();
if(locks!=null) {
for(int y=0;y<locks.length;y++){
al=locks[y];
row = lck.addRow();
lck.setAt(KeyConstants._web, row, web.getLabel());
lck.setAt(KeyConstants._application, row, _pc.getApplicationContext().getName());
lck.setAt(KeyConstants._name, row, al.name);
lck.setAt(START_TIME, row, new DateTimeImpl(web,al.startTime,true));
lck.setAt(KeyConstants._timeout, row, Caster.toDouble(al.timeoutInMillis/1000));
lck.setAt(KeyConstants._type, row, al.type==LockManager.TYPE_EXCLUSIVE?"exclusive":"readonly");
}
}
}
openConnections+=web.getDatasourceConnectionPool().openConnections();
// Template Cache
Mapping[] mappings = ConfigImpl.getAllMappings(web);
long[] tce = templateCacheElements(mappings);
row = tc.addRow();
tc.setAt(KeyConstants._web, row, web.getLabel());
tc.setAt(KeyConstants._size, row, new Double(tce[1]));
tc.setAt(ELEMENTS, row, new Double(tce[0]));
// Scope Application
getAllApplicationScopes(web,factory.getScopeContext(),app);
getAllCFSessionScopes(web,factory.getScopeContext(),sess);
}
// Datasource
Struct ds=new StructImpl();
sct.setEL(KeyConstants._datasources, ds);
ds.setEL(CACHED_QUERIES, Caster.toDouble(pc.getQueryCache().size(pc))); // there is only one cache for all contexts
ds.setEL(OPEN_CONNECTIONS, Caster.toDouble(openConnections));
// Memory
Struct mem=new StructImpl();
sct.setEL(KeyConstants._memory, mem);
mem.setEL("heap", SystemUtil.getMemoryUsageAsStruct(SystemUtil.MEMORY_TYPE_HEAP));
mem.setEL("nonheap", SystemUtil.getMemoryUsageAsStruct(SystemUtil.MEMORY_TYPE_NON_HEAP));
// uptime
sct.set("uptime", new DateTimeImpl(engine.uptime(),true));
// now
sct.set("now", new DateTimeImpl(pc));
//SizeAndCount.Size size = SizeAndCount.sizeOf(pc.serverScope());