use of lucee.runtime.type.DoubleStruct in project Lucee by lucee.
the class Surveillance method getInfo.
public static Struct getInfo(ConfigImpl config) throws PageException {
Struct sct = new StructImpl();
// memory
DoubleStruct mem = new DoubleStruct();
sct.set(KeyConstants._memory, mem);
getInfoMemory(mem, config);
return sct;
}
use of lucee.runtime.type.DoubleStruct in project Lucee by lucee.
the class Surveillance method infoScopes.
private static void infoScopes(Struct web, Struct server, ConfigWeb config) throws PageException {
ScopeContext sc = ((CFMLFactoryImpl) config.getFactory()).getScopeContext();
DoubleStruct webScopes = new DoubleStruct();
DoubleStruct srvScopes = new DoubleStruct();
long s;
s = sc.getScopesSize(Scope.SCOPE_SESSION);
webScopes.set("session", Caster.toDouble(s));
s = sc.getScopesSize(Scope.SCOPE_APPLICATION);
webScopes.set("application", Caster.toDouble(s));
s = sc.getScopesSize(Scope.SCOPE_CLUSTER);
srvScopes.set("cluster", Caster.toDouble(s));
s = sc.getScopesSize(Scope.SCOPE_SERVER);
srvScopes.set("server", Caster.toDouble(s));
s = sc.getScopesSize(Scope.SCOPE_CLIENT);
webScopes.set("client", Caster.toDouble(s));
web.set(KeyConstants._scopes, webScopes);
server.set(KeyConstants._scopes, srvScopes);
}
use of lucee.runtime.type.DoubleStruct in project Lucee by lucee.
the class Surveillance method _getInfoMemory.
private static void _getInfoMemory(Struct web, Struct server, ConfigWeb config) throws PageException {
DoubleStruct sct = new DoubleStruct();
infoMapping(sct, config);
// infoResources(sct,config);
infoScopes(sct, server, config);
infoPageContextStack(sct, config.getFactory());
// infoQueryCache(sct,config.getFactory());
// size+=infoResources(sct,cs);
web.set(config.getConfigDir().getPath(), sct);
}
use of lucee.runtime.type.DoubleStruct in project Lucee by lucee.
the class Surveillance method infoMapping.
private static void infoMapping(Struct parent, Config config) throws PageException {
DoubleStruct map = new DoubleStruct();
infoMapping(map, config.getMappings(), false);
infoMapping(map, config.getCustomTagMappings(), true);
parent.set(KeyConstants._mappings, map);
}
use of lucee.runtime.type.DoubleStruct in project Lucee by lucee.
the class Surveillance method infoMapping.
private static void infoMapping(Struct map, Mapping[] mappings, boolean isCustomTagMapping) throws PageException {
if (mappings == null)
return;
DoubleStruct sct = new DoubleStruct();
long size;
MappingImpl mapping;
for (int i = 0; i < mappings.length; i++) {
mapping = (MappingImpl) mappings[i];
// archive classloader
size = mapping.getArchive() != null ? mapping.getArchive().length() : 0;
sct.set("archiveClassLoader", Caster.toDouble(size));
// physical classloader
size = mapping.getPhysical() != null ? mapping.getPhysical().length() : 0;
sct.set("physicalClassLoader", Caster.toDouble(size));
// pagepool
size = SizeOf.size(mapping.getPageSourcePool());
sct.set(PAGE_POOL, Caster.toDouble(size));
map.set(!isCustomTagMapping ? mapping.getVirtual() : mapping.getStrPhysical(), sct);
}
}
Aggregations