use of lucee.runtime.dump.DumpTable in project Lucee by lucee.
the class DebugPageImpl method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
DumpTable table = new DumpTable("#cccc66", "#cccc99", "#000000");
table.setTitle(file.getAbsolutePath());
table.appendRow(1, new SimpleDumpData("min (ms)"), new SimpleDumpData(min));
table.appendRow(1, new SimpleDumpData("avg (ms)"), new SimpleDumpData(getAverageExecutionTime()));
table.appendRow(1, new SimpleDumpData("max (ms)"), new SimpleDumpData(max));
table.appendRow(1, new SimpleDumpData("total (ms)"), new SimpleDumpData(all));
return table;
}
use of lucee.runtime.dump.DumpTable in project Lucee by lucee.
the class PageSourcePool method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
maxlevel--;
Iterator<PageSource> it = pageSources.values().iterator();
DumpTable table = new DumpTable("#FFCC00", "#FFFF00", "#000000");
table.setTitle("Page Source Pool");
table.appendRow(1, new SimpleDumpData("Count"), new SimpleDumpData(pageSources.size()));
while (it.hasNext()) {
PageSource ps = it.next();
DumpTable inner = new DumpTable("#FFCC00", "#FFFF00", "#000000");
inner.setWidth("100%");
inner.appendRow(1, new SimpleDumpData("source"), new SimpleDumpData(ps.getDisplayPath()));
inner.appendRow(1, new SimpleDumpData("last access"), DumpUtil.toDumpData(new DateTimeImpl(pageContext, ps.getLastAccessTime(), false), pageContext, maxlevel, dp));
inner.appendRow(1, new SimpleDumpData("access count"), new SimpleDumpData(ps.getAccessCount()));
table.appendRow(1, new SimpleDumpData("Sources"), inner);
}
return table;
}
use of lucee.runtime.dump.DumpTable in project Lucee by lucee.
the class StaticScope method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
int access = c.getAccess(pageContext);
DumpTable table = new DumpTable("component", "#99cc99", "#ccffcc", "#000000");
table.setTitle("Static Scope from Component " + cp.getComponentName());
table.setComment("Only the functions and data members that are accessible from your location are displayed");
DumpTable content = _toDumpData(c.top, pageContext, maxlevel, dp, access);
if (!content.isEmpty())
table.appendRow(1, new SimpleDumpData(""), content);
return table;
}
use of lucee.runtime.dump.DumpTable in project Lucee by lucee.
the class HTTPCacheItem method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties properties) {
DumpTable table = new DumpTable("#669999", "#ccffff", "#000000");
table.setTitle("HTTPCacheEntry");
table.appendRow(1, new SimpleDumpData("Output"), data.toDumpData(pageContext, maxlevel, properties));
if (url != null)
table.appendRow(1, new SimpleDumpData("URL"), DumpUtil.toDumpData(new SimpleDumpData(url), pageContext, maxlevel, properties));
return table;
}
use of lucee.runtime.dump.DumpTable in project Lucee by lucee.
the class HTTPClient method toDumpData.
@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
try {
Array args;
Struct sct = getMetaData(pageContext), val, a;
DumpTable cfc = new DumpTable("udf", "#66ccff", "#ccffff", "#000000"), udf, arg;
cfc.setTitle("Web Service (HTTP)");
if (dp.getMetainfo())
cfc.setComment(url.toExternalForm());
Iterator<Entry<Key, Object>> it = sct.entryIterator();
Entry<Key, Object> e;
// Loop UDFs
while (it.hasNext()) {
e = it.next();
val = Caster.toStruct(e.getValue());
// udf name
udf = new DumpTable("udf", "#66ccff", "#ccffff", "#000000");
arg = new DumpTable("udf", "#66ccff", "#ccffff", "#000000");
cfc.appendRow(1, new SimpleDumpData(e.getKey().getString()), udf);
// args
args = Caster.toArray(val.get(KeyConstants._arguments));
udf.appendRow(1, new SimpleDumpData("arguments"), arg);
arg.appendRow(7, new SimpleDumpData("name"), new SimpleDumpData("required"), new SimpleDumpData("type"));
Iterator<Object> ait = args.valueIterator();
while (ait.hasNext()) {
a = Caster.toStruct(ait.next());
arg.appendRow(0, new SimpleDumpData(Caster.toString(a.get(KeyConstants._name))), new SimpleDumpData(Caster.toString(a.get(KeyConstants._required))), new SimpleDumpData(Caster.toString(a.get(KeyConstants._type))));
}
// return type
udf.appendRow(1, new SimpleDumpData("return type"), new SimpleDumpData(Caster.toString(val.get(KeyConstants._returntype))));
/*
cfc.appendRow(new DumpRow(0,new DumpData[]{
new SimpleDumpData(arg.getDisplayName()),
new SimpleDumpData(e.getKey().getString()),
new SimpleDumpData(arg.isRequired()),
new SimpleDumpData(arg.getTypeAsString()),
def,
new SimpleDumpData(arg.getHint())}));*/
}
return cfc;
} catch (Throwable t) {
ExceptionUtil.rethrowIfNecessary(t);
throw new PageRuntimeException(Caster.toPageException(t));
}
}
Aggregations