Search in sources :

Example 1 with DoubleStruct

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;
}
Also used : StructImpl(lucee.runtime.type.StructImpl) DoubleStruct(lucee.runtime.type.DoubleStruct) Struct(lucee.runtime.type.Struct) DoubleStruct(lucee.runtime.type.DoubleStruct)

Example 2 with DoubleStruct

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);
}
Also used : ScopeContext(lucee.runtime.type.scope.ScopeContext) CFMLFactoryImpl(lucee.runtime.CFMLFactoryImpl) DoubleStruct(lucee.runtime.type.DoubleStruct)

Example 3 with DoubleStruct

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);
}
Also used : DoubleStruct(lucee.runtime.type.DoubleStruct)

Example 4 with DoubleStruct

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);
}
Also used : DoubleStruct(lucee.runtime.type.DoubleStruct)

Example 5 with DoubleStruct

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);
    }
}
Also used : DoubleStruct(lucee.runtime.type.DoubleStruct) MappingImpl(lucee.runtime.MappingImpl)

Aggregations

DoubleStruct (lucee.runtime.type.DoubleStruct)6 CFMLFactoryImpl (lucee.runtime.CFMLFactoryImpl)1 MappingImpl (lucee.runtime.MappingImpl)1 ConfigServer (lucee.runtime.config.ConfigServer)1 ConfigWeb (lucee.runtime.config.ConfigWeb)1 Struct (lucee.runtime.type.Struct)1 StructImpl (lucee.runtime.type.StructImpl)1 ScopeContext (lucee.runtime.type.scope.ScopeContext)1