Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Instrumenter to observe behavior of nodes with UUID #7833

Merged
merged 35 commits into from
Oct 10, 2023

Conversation

JaroslavTulach
Copy link
Member

@JaroslavTulach JaroslavTulach commented Sep 18, 2023

Pull Request Description

Exposing instrumentation capabilities to Enso. Fixes #7683.

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
  • All code has been tested:
    • Unit tests have been written where possible.

@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Sep 18, 2023

How can one register the callbacks?

enable_instrumentation =
    called uuid:Text =
        IO.println "starting: "+uuid
    update uuid:Text result =
        IO.println "finished: "+uuid+" with value: "+result.to_text
    fn uuid:Text fn:Function args:(Vector Any) =
        IO.println "fn_call: "+uuid+" with fn: "+fn.to_text

    builder = Meta.meta .func1 . instrument
    builder . on_enter called . on_return update . on_call fn . activate

and then make sure you call this registration before doing the main work:

main =
    operator3 = enable_instrumentation
   ....

@JaroslavTulach JaroslavTulach added the CI: Ready to merge This PR is eligible for automatic merge label Oct 5, 2023
@hubertp
Copy link
Contributor

hubertp commented Oct 5, 2023

DEBUG main_internal:Running process.{command=Command:
	"C:\\Windows\\system32\\cmd.exe" "/C" "C:\\runner\\_work\\enso\\enso\\built-distribution\\enso-engine-2023.2.1-dev-windows-amd64\\enso-2023.2.1-dev\\bin\\enso.bat" "--no-ir-caches" "--run" "C:\\runner\\_work\\enso\\enso\\test\\Tests"
	with environment overrides:
		ENSO_JVM_OPTS=-enableassertions}: ide_ci::program::command: Spawning.
TRACE ide_ci::program::command: cmdℹ️ <START>
TRACE ide_ci::program::command: cmd⚠️ <START>
 INFO ide_ci::program::command: cmd⚠️ Oct 05, 2023 5:38:57 PM org.jline.utils.Log logr
 INFO ide_ci::program::command: cmd⚠️ WARNING: Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
 INFO ide_ci::program::command: cmdℹ️ C:\runner\_work\enso\enso\test\Tests\src\Semantic\Instrumentor_Spec.enso:192:1: error: Unexpected expression.
 INFO ide_ci::program::command: cmdℹ️   192 | [[{"index":{"value":127},"size":{"value":3}},"00000000-aaaa-bbbb-0000-000000000000"],[{"index":{"value":69},"size":{"value":61}},"00000000-ffff-bbbb-0000-000000000000"],[{"index":{"value":214},"size":{"value":5}},"00000000-eeee-bbbb-2222-000000000000"]]

legit failure (surprisingly only on windows)

@JaroslavTulach
Copy link
Member Author

JaroslavTulach commented Oct 6, 2023

[[{"index":{"value":127},"size":{"value":3}},"00000000-aaaa-bbbb-0000-000000000000"],[{"index":{"value":69},"size":{"value":61}},"00000000-ffff-bbbb-0000-000000000000"],[{"index":{"value":214},"size":{"value":5}},"00000000-eeee-bbbb-2222-000000000000"]]

Legit failure on Windows!? Oh, no the meta-data section parsing is so fragile. For example I wanted to format each UUID on separate line e.g.:

[
  [{"index":{"value":127},"size":{"value":3}},"00000000-aaaa-bbbb-0000-000000000000"],
  [{"index":{"value":69},"size":{"value":61}},"00000000-ffff-bbbb-0000-000000000000"],
  [{"index":{"value":214},"size":{"value":5}},"00000000-eeee-bbbb-2222-000000000000"]
]

and that failed. CCing @kazcw, can't we:

  • do regular JSON parsing?
  • shifting the data four spaces right - to make them comment unless somebody really requests them
  • make the data a bit dense? {"index":{"value": and "size":{"value"": are just wasting the space

Summarized as #7989 and now I have to boot into Windows to find out what is wrong...

@JaroslavTulach JaroslavTulach added the CI: Keep up to date Automatically update this PR to the latest develop. label Oct 7, 2023
@JaroslavTulach JaroslavTulach added the CI: Clean build required CI runners will be cleaned before and after this PR is built. label Oct 9, 2023
@JaroslavTulach JaroslavTulach removed the CI: Keep up to date Automatically update this PR to the latest develop. label Oct 9, 2023
@JanBeelte JanBeelte removed their request for review October 9, 2023 10:04
@mergify mergify bot merged commit a234e82 into develop Oct 10, 2023
34 checks passed
@mergify mergify bot deleted the wip/jtulach/Instrumenter_7683 branch October 10, 2023 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow access to caches and instrumentation from Enso
6 participants