use of com.enonic.xp.trace.Trace in project xp by enonic.
the class TraceServiceTest method testNewTrace.
@Test
public void testNewTrace() {
final Trace trace = this.service.newTrace("test", null);
assertNotNull(trace);
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class NodeServiceImpl method findByQuery.
@Override
public FindNodesByQueryResult findByQuery(final NodeQuery nodeQuery) {
final Trace trace = Tracer.newTrace("node.findByQuery");
if (trace == null) {
return executeFindByQuery(nodeQuery);
}
return Tracer.trace(trace, () -> {
trace.put("query", nodeQuery.getQuery() != null ? nodeQuery.getQuery().toString() : "");
trace.put("from", nodeQuery.getFrom());
trace.put("size", nodeQuery.getSize());
final FindNodesByQueryResult result = executeFindByQuery(nodeQuery);
trace.put("hits", result.getTotalHits());
return result;
});
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class NodeServiceImpl method getByPathAndVersionId.
@Override
public Node getByPathAndVersionId(final NodePath path, final NodeVersionId versionId) {
final Trace trace = Tracer.newTrace("node.getByPathAndVersionId");
if (trace == null) {
return executeGetByPathAndVersionId(path, versionId);
}
return Tracer.trace(trace, () -> {
trace.put("path", path);
trace.put("versionId", versionId);
final Node node = executeGetByPathAndVersionId(path, versionId);
if (node != null) {
trace.put("id", node.id());
}
return node;
});
}
use of com.enonic.xp.trace.Trace in project xp by enonic.
the class NodeServiceImpl method findByParent.
@Override
public FindNodesByParentResult findByParent(final FindNodesByParentParams params) {
final Trace trace = Tracer.newTrace("node.findByParent");
if (trace == null) {
return executeFindByParent(params);
}
return Tracer.trace(trace, () -> {
trace.put("parent", params.getParentPath() != null ? params.getParentPath() : params.getParentId());
trace.put("from", params.getFrom());
trace.put("size", params.getSize());
final FindNodesByParentResult result = executeFindByParent(params);
trace.put("hits", result.getTotalHits());
return result;
});
}
Aggregations