Home

Visualize dataflow elements

If I dump an instance of ActionBlock, then I can see the number being handled in the "DataFlow" tab of the output window inside the boxes representing either the task being performed or the queue of the actionblock.
However, the visualizer doesn't seem to be able to handle classes. If I try to dump an instance of ActionBlock, then there is no text inside the boxes at all. The state being passed from one block to the next representing a piece of work will often be a custom class. Is there any way that I can add visualizations? It would even be helpful if just "ToString()" overrides worked.

Comments

  • What does it display when you click on the elements?
  • Woah! Thanks.
    The input queue elements are now rendered with the ToString() output.
    Is there some other trick to get the Items that are being processed rendered like that, too? If some item is blocking a particular piece of the flow, then I would like to know which item that is. http://share.linqpad.net/jkgkr2.linq
    This is a crude rewrite of your example. Notice that you cannot "expand" the items currently being processed inside the transform block (items in red).
  • Is there anything I can do make this work? I assume that LINQPad is using third party component to visualize dataflow. Should I take the questions there?
  • The Dataflow visualizer is built into LINQPad. The reason that you can't expand the red items is that there's no way to get their values via the debugger proxy interface:
    var pa = (DebuggerTypeProxyAttribute)block.GetType ()
      .GetCustomAttributes (typeof (DebuggerTypeProxyAttribute), true)
      .FirstOrDefault ();
    
    Type pType = Type.GetType (pa.ProxyTypeName);
    Type genericPType = pType.MakeGenericType (block.GetType().GetGenericArguments ());
    var proxy = Activator.CreateInstance (genericPType, block);
    
    // proxy does not expose any property to get at the executing items
    Let me know if you can see a workaround.
Sign In or Register to comment.