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

Feature request: Verbose output/debug info option #40

Open
mdeguzis opened this issue Feb 1, 2023 · 4 comments
Open

Feature request: Verbose output/debug info option #40

mdeguzis opened this issue Feb 1, 2023 · 4 comments

Comments

@mdeguzis
Copy link

mdeguzis commented Feb 1, 2023

Could we add a debug / verbose option so we know the command is doing things in the background? Is the command hiding all the output from cdk synth?

npx cdk-dia --tree cdk.out/tree.json --target diagram.png 

Unfortunately, the stack I am working with has 2 million (yes 2 million) lines in tree.json

@pistazie
Copy link
Owner

pistazie commented Feb 3, 2023

HI @mdeguzis ,

Wow, 2 million lines!

cdk-dia doesn't hide cdk synth, it doesn't even use it. It assumes / requests you did it ran it before and therefore the tree.json exists.

Generally, it has four main steps: import tree -> generate diagram (an internal representation) -> render to a .dot file -> execute Graphviz in the .dot file.

I am happy to add a -v flag that will report these steps so we can get an idea of what is taking so long.

Meanwhile, you might want to inspect whether a diagram.dot has bee generated. That would indicate where is the process stuck. My wild guess is that Graphviz is taking long. You might want to consider using the --include flag to generate sub diagrams.

@mdeguzis
Copy link
Author

mdeguzis commented Feb 6, 2023

Yes :)

$ wc -l build/cdk.out/tree.json 
2,351,246 build/cdk.out/tree.json

Meanwhile, you might want to inspect whether a diagram.dot has bee generated
Where is diagram.dot? You mean diagram.png? Or a similar file in my output directory?

@pistazie
Copy link
Owner

pistazie commented Feb 6, 2023

it should be in you cdk app work directory. in the same one where diagram.png is created on a success run

@mdeguzis
Copy link
Author

mdeguzis commented Feb 6, 2023

I let it go for a while and it does complete. It's very interesting, as the PNG is extremely horizontal and the more I zoom, the more pixelated it is:

image

I'll have to look into the sub diagrams you mentioned.

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