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

Implement JsonTracer HTML viewer #1611

Open
dayo09 opened this issue Jul 31, 2023 · 7 comments
Open

Implement JsonTracer HTML viewer #1611

dayo09 opened this issue Jul 31, 2023 · 7 comments

Comments

@dayo09
Copy link
Contributor

dayo09 commented Jul 31, 2023

What?

As mentioned in workshop 2023, let's find the way to show json trace files formatted in html file.

@dayo09 dayo09 changed the title Implement html JsonTracer Implement JsonTracer HTML viewer Jul 31, 2023
@ejjeong
Copy link

ejjeong commented Jul 31, 2023

FYI #1183 (comment) this is the tool that I've mentioned offline :)

@dayo09
Copy link
Contributor Author

dayo09 commented Jul 31, 2023

Good it works well, thanks :-D

@dayo09
Copy link
Contributor Author

dayo09 commented Jul 31, 2023

How to view HTML in vscode?

  • VSCode doesn't have built-in support for HTML preview.
  • Microsoft/LivePreview extension supports html preview in vscode.
  • TODO add the extension as a dependency after implementing the feature (?)

@dayo09
Copy link
Contributor Author

dayo09 commented Jul 31, 2023

Preview in microsoft/LivePreview

0731-preview

@dayo09
Copy link
Contributor Author

dayo09 commented Jul 31, 2023

How to embed?

I found briefly 2 possible ways to achieve our goal. IDK if either of them works yet.

(1) Use trace2html file

npm i traceviewer
./node_modules/traceviewer/tracing/bin/trace2html res/samples/traces/sample.timeline.json
  • Not working, python version issue (Missing parentheses in call to 'print')

(2) Vulcanize the viewer

npm i traceviewer
./node_modules/traceviewer/tracing/bin/vulcanize_trace_viewer
  • Not working, 'No module named 'py_vulcanize'' issue.

Issue: not enough packages in node_modules/traceviewer

  • When I run python program in its original repository, it runs well.
# Printed path and python version
./tracing/bin/trace2html ../ONE-vscode/res/samples/traces/sample.timeline.json                                                              ✔  9161  12:15:22

3.9.12 (main, Apr  5 2022, 06:56:58) 
[GCC 7.5.0]
/home/dayo/git/catapult/tracing/third_party/symbols
/home/dayo/git/catapult/common/py_utils
/home/dayo/git/catapult/third_party/webapp2
/home/dayo/git/catapult/third_party/six
/home/dayo/git/catapult/third_party/Paste
/home/dayo/git/catapult/third_party/WebOb
/home/dayo/git/catapult/third_party/gae_ts_mon/gae_ts_mon/protobuf-3.20.0
/home/dayo/git/catapult/third_party/vinn
/home/dayo/git/catapult/common/py_vulcanize
/home/dayo/git/catapult
/home/dayo/git/catapult/tracing/bin
/home/dayo/anaconda3/lib/python39.zip
/home/dayo/anaconda3/lib/python3.9
/home/dayo/anaconda3/lib/python3.9/lib-dynload
/home/dayo/anaconda3/lib/python3.9/site-packages
/home/dayo/git/catapult/tracing
../ONE-vscode/res/samples/traces/sample.timeline.html
  • When I run python program in installed node_modules, it doesn't work.
  • It seems that not enough python packages are included in node packages.
# Printed path and python version
./tracing/bin/trace2html /home/dayo/git/ONE-vscode/res/samples/traces/sample.timeline.json 
3.8.16 (default, Mar  2 2023, 03:21:46) 
[GCC 11.2.0]
/home/dayo/git/ONE-vscode/node_modules/traceviewer/third_party/webapp2
/home/dayo/git/ONE-vscode/node_modules/traceviewer/third_party/six
/home/dayo/git/ONE-vscode/node_modules/traceviewer/third_party/Paste
/home/dayo/git/ONE-vscode/node_modules/traceviewer/third_party/WebOb
/home/dayo/git/ONE-vscode/node_modules/traceviewer/third_party/vinn
/home/dayo/git/ONE-vscode/node_modules/traceviewer/third_party/py_vulcanize
/home/dayo/git/ONE-vscode/node_modules/traceviewer
/home/dayo/git/ONE-vscode/node_modules/traceviewer/tracing/bin
/home/dayo/anaconda3/envs/py38/lib/python38.zip
/home/dayo/anaconda3/envs/py38/lib/python3.8
/home/dayo/anaconda3/envs/py38/lib/python3.8/lib-dynload
/home/dayo/.local/lib/python3.8/site-packages
/home/dayo/anaconda3/envs/py38/lib/python3.8/site-packages
/home/dayo/git/ONE-vscode/node_modules/traceviewer/tracing
Traceback (most recent call last):
  File "./tracing/bin/trace2html", line 13, in <module>
    from tracing_build import trace2html
  File "/home/dayo/git/ONE-vscode/node_modules/traceviewer/tracing/tracing_build/trace2html.py", line 22, in <module>
    from py_vulcanize import generate
ModuleNotFoundError: No module named 'py_vulcanize'

@dayo09
Copy link
Contributor Author

dayo09 commented Aug 8, 2023

Add catapult as a submodule

Why?

I tried to import only the related catapult directories. It exceeded 3000+ lines changes, as can be seen in this PR

For extensibility, it could be better to import the project as a submodule.

@dayo09
Copy link
Contributor Author

dayo09 commented Aug 11, 2023

https://github.com/microsoft/vscode-python-tools-extension-template

Let's investigate how to integrate python files.

  • It uses nox to manage python env / dependencies.
  • nox installs python libraries into bundle/libs. (I think bundling python libs are required for our project, too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants