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

Debugging. #60

Open
romansl opened this issue Jul 10, 2015 · 1 comment
Open

Debugging. #60

romansl opened this issue Jul 10, 2015 · 1 comment

Comments

@romansl
Copy link

romansl commented Jul 10, 2015

For practical use library needs strong debug functionality. If something goes wrong it is hard to understand the reason. Other libs has interesting tools for it.

For example: https://github.com/jaredly/rxvision

Tools we need:

  1. Memory leak detector.
  2. Tree structure viewer.
  3. Runtime operations printer.

For my implementation I workong on Tree Viewer. Single function dump(s: Stream<*>) prints to log tree structure in dot format.

For example this structure of function Stream.collect from testCollect:

digraph G {
{node [shape=box;style=filled;color=lightgrey;]"Node:19651F3";"Node:157696F";"Node:67C67E";"Node:BC8AB5";"Node:C1670B";"Node:1B21B69";"Node:7080DC";}
"Node:19651F3" [label="map - StreamImpl.kt:192\nrank=2"];
"Node:157696F" [label="snapshot - StreamImpl.kt:188\nrank=1"];
"Node:67C67E" [label="Node:67C67E\nrank=9223372036854775807"];
"Node:BC8AB5" [label="<init> - StreamImpl.kt:186\nrank=3"];
"Node:C1670B" [label="<init> - Sodium.kt:14\nrank=0"];
"Node:1B21B69" [label="map - StreamImpl.kt:189\nrank=2"];
"Node:7080DC" [label="lastFiringOnly - CellImpl.kt:23\nrank=4"];
"Node:C1670B" -> "Target:18D30F7"
"Target:18D30F7" -> "Node:157696F"
"Target:18D30F7" -> "action:1D2A7E8"
"Node:157696F" -> "Target:57CD70"
"Target:57CD70" -> "Node:1B21B69"
"Target:57CD70" -> "action:9273A8"
"Node:1B21B69" -> "Target:7D1D39"
"Target:7D1D39" -> "Node:67C67E"
"Target:7D1D39" -> "action:A7B76D"
"Node:157696F" -> "Target:1A7504C"
"Target:1A7504C" -> "Node:19651F3"
"Target:1A7504C" -> "action:BDB505"
"Node:19651F3" -> "Target:39AC6"
"Target:39AC6" -> "Node:BC8AB5"
"Target:39AC6" -> "action:E6A65D"
"Node:BC8AB5" -> "Target:16E852B"
"Target:16E852B" -> "Node:7080DC"
"Target:16E852B" -> "action:100955A"
"Node:7080DC" -> "Target:D2FA64"
"Target:D2FA64" -> "Node:67C67E"
"Target:D2FA64" -> "action:874448"
}

You can visualize this code in online tool: http://www.webgraphviz.com/

@the-real-blackh
Copy link

Yes - these are great things to do. I don't have time for any of it at the moment but let's leave this open.

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

No branches or pull requests

2 participants