added basic timing output to logs for hover and completion computation
This commit is contained in:
@@ -122,6 +122,8 @@ public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
|
||||
|
||||
@Override
|
||||
public CompletionList getCompletions(CancelChecker cancelToken, TextDocumentPositionParams params) {
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
SimpleTextDocumentService documents = server.getTextDocumentService();
|
||||
|
||||
TextDocument doc = documents.getLatestSnapshot(params);
|
||||
@@ -195,7 +197,8 @@ public class VscodeCompletionEngineAdapter implements VscodeCompletionEngine {
|
||||
log.info("error while compututing completions", e);
|
||||
}
|
||||
finally {
|
||||
log.info("Got {} completions", list.getItems().size());
|
||||
long end = System.currentTimeMillis();
|
||||
log.info("Got {} completions in " + (end - start) + "ms", list.getItems().size());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -302,7 +302,10 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
|
||||
}
|
||||
|
||||
private Hover computeHover(CancelChecker cancelToken, HoverParams hoverParams) {
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
try {
|
||||
|
||||
log.debug("hover handler starting");
|
||||
HoverHandler h = hoverHandler;
|
||||
if (h != null) {
|
||||
@@ -311,8 +314,10 @@ public class SimpleTextDocumentService implements TextDocumentService, DocumentE
|
||||
}
|
||||
log.debug("no hover because there is no handler");
|
||||
return null;
|
||||
|
||||
} finally {
|
||||
log.debug("hover handler finished");
|
||||
long end = System.currentTimeMillis();
|
||||
log.info("hover computation done in " + (end - start) + "ms");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user