Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Show warnings when a request is slow #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/languageserverinstance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,13 @@
JSONRPC.dispatch_msg(server.jr_endpoint, msg_dispatcher, msg)
toc = time_ns()
duration = (toc - tic) / 1e+6
if 1e-3duration > 1
req = msg["method"]
if req != "initialize" && req != "initialized" # these requests will certainly take a bit, so don't want on them
@warn "Request $req took a long time ($(round(Int, duration)) ms)."

Check warning on line 450 in src/languageserverinstance.jl

View check run for this annotation

Codecov / codecov/patch

src/languageserverinstance.jl#L450

Added line #L450 was not covered by tests
end
end


if server._send_request_metrics
JSONRPC.send(
Expand Down
Loading