import org.simantics.db.layer0.request.VariableRead;
import org.simantics.db.layer0.variable.Variable;
import org.simantics.document.server.DocumentServerUtils.AttributesRequest;
+import org.simantics.utils.threads.logger.ITask;
+import org.simantics.utils.threads.logger.ThreadLogger;
import org.simantics.document.server.JSONObject;
public class NodeRequest extends VariableRead<JSONObject> {
@Override
public JSONObject perform(ReadGraph graph) throws DatabaseException {
- long s = DocumentRequest.PROFILE ? System.nanoTime() : 0L;
- JSONObject staticContent = graph.syncRequest(new AttributesRequest(variable));
+ ITask task = DocumentRequest.PROFILE ? ThreadLogger.task(this) : null;
- if (DocumentRequest.PROFILE) {
- long dura = System.nanoTime()-s;
- if (dura > DocumentRequest.PROFILE_THRESHOLD_NODEREQUEST * 1e3) {
- System.err.println("NodeRequest " + System.identityHashCode(this) + " in " + 1e-6*dura + "ms. " + variable.getURI(graph));
- }
- }
+ JSONObject staticContent = graph.syncRequest(new AttributesRequest(variable));
+ if(DocumentRequest.PROFILE) task.finish();
+
return staticContent;
}