Allow CTRL-C interruption of profile command + macro debug logs#1206
Open
lekemula wants to merge 2 commits into
Open
Allow CTRL-C interruption of profile command + macro debug logs#1206lekemula wants to merge 2 commits into
lekemula wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small developer-experience changes that came out of profiling YARD macro processing for the comment at #1194 (comment):
solargraph profile: trapSIGINTand rescueInterruptso a long-running phase can be aborted with CTRL-C and the in-progress Vernier profile is still written via itsensureclause. The summary now reports only the phases that actually completed and lists the profile files that exist on disk. A second CTRL-C restores default handling for a hard exit.ApiMap#process_macros: add a fewSolargraph.logger.debug { ... }lines around macro processing (source-map count, store macro counts, per-file candidate counts). Used while gathering the data behind the linked comment.Context
These changes were used to produce the profiling/log data referenced in the comment on PR #1194 (YARD macros). The profile-command change in particular was needed because some phases of
solargraph profilecan run for a long time on large workspaces, and without trapping CTRL-C the partial Vernier output was lost.Test plan
solargraph profile -d <workspace>finishes normally and writes the three*_benchmark.json.gzfiles as before.Vernier.profileblock unwinds through itsensureand writes its output file, the summary lists timings for completed phases only, and the script exits cleanly (no stack trace).INThandling.SOLARGRAPH_LOG=debugis set (default iswarn), so default users see no change.