use of org.perf4j.StopWatch in project cuba by cuba-platform.
the class ScreenXmlLoader method load.
/**
* Loads a descriptor.
* @param resourcePath path to the resource containing the XML
* @param id screen ID
* @param params screen parameters
* @return root XML element
*/
public Element load(String resourcePath, String id, Map<String, Object> params) {
StopWatch xmlLoadWatch = new Slf4JStopWatch(id + "#" + UIPerformanceLogger.LifeCycle.XML, LoggerFactory.getLogger(UIPerformanceLogger.class));
String template = loadTemplate(resourcePath);
Document document = getDocument(template, params);
xmlLoadWatch.stop();
return document.getRootElement();
}
use of org.perf4j.StopWatch in project cuba by cuba-platform.
the class AbstractTreeDatasource method loadData.
@Override
protected void loadData(Map<String, Object> params) {
String tag = getLoggingTag("TDS");
StopWatch sw = new Slf4JStopWatch(tag, LoggerFactory.getLogger(UIPerformanceLogger.class));
clear();
this.tree = loadTree(params);
Map<K, Node<T>> targetNodes = new HashMap<>();
if (tree != null) {
for (Node<T> node : tree.toList()) {
final T entity = node.getData();
final K id = entity.getId();
data.put(id, entity);
attachListener(entity);
targetNodes.put(id, node);
}
}
this.nodes = targetNodes;
sw.stop();
}
use of org.perf4j.StopWatch in project cuba by cuba-platform.
the class ValueGroupDatasourceImpl method loadData.
@Override
protected void loadData(Map<String, Object> params) {
String tag = getLoggingTag("VGDS");
StopWatch sw = new Slf4JStopWatch(tag, LoggerFactory.getLogger(UIPerformanceLogger.class));
delegate.loadData(params);
sw.stop();
}
use of org.perf4j.StopWatch in project cuba by cuba-platform.
the class ValueHierarchicalDatasourceImpl method loadData.
@Override
protected void loadData(Map<String, Object> params) {
String tag = getLoggingTag("VHDS");
StopWatch sw = new Slf4JStopWatch(tag, LoggerFactory.getLogger(UIPerformanceLogger.class));
delegate.loadData(params);
sw.stop();
}
use of org.perf4j.StopWatch in project cuba by cuba-platform.
the class ClusterManager method printSharedStateStat.
@Override
public String printSharedStateStat() {
StringBuilder clusterStateStat = new StringBuilder();
for (Map.Entry<String, ClusterListener> entry : listeners.entrySet()) {
byte[] data = null;
StopWatch sw = new StopWatch();
try {
data = entry.getValue().getState();
} finally {
sw.stop();
}
clusterStateStat.append(String.format("State: %s, size: %s bytes, serialize time: %s ms\n", entry.getKey(), data != null ? data.length : -1, sw.getElapsedTime()));
}
return clusterStateStat.toString();
}
Aggregations