This is a library to easily visualize the progress of a TPL Dataflow in a Console application.
Usage instructions: To use this library you should replace all existing TPL Dataflow block names with Deve*****Block. E.g. change:
var blockOld = new TransformManyBlock<int, string>((input) =>
{
return Enumerable.Range(0, input).Select(t => $"Super test: {t}");
});
To:
var blockNew = new DeveTransformManyBlock<int, string>("Video -> Frame", (input) =>
{
return Enumerable.Range(0, input).Select(t => $"Super test: {t}");
});
After that you can use the following piece of code to visualize the different blocks:
_ = Task.Run(async () =>
{
var baume = new Tree("Root");
var baumeNode = new TreeNode(new Text("RootNode"));
baume.AddNode(baumeNode);
AnsiConsole.Live(baume)
.Start(ctx =>
{
while (true)
{
baumeNode.Nodes.Clear();
SpectreConsoleRenderer.SuperBaumenMacher(b1_extractFramesFromVideo, baumeNode, (block) => block == b1_extractFramesFromVideo ? 1 : b1_broadcast.ProcessedCount);
ctx.Refresh();
Thread.Sleep(50);
}
});
});
For more information see the example Program.cs
Also, I'm not even german, I was just in a funny mood when making up the names for the SuperBaumenMacher
...
All Deve....Blocks extend the DeveBaseBlock which wraps the internal Actions and counts up all executions of Actions that are being processed / have been processed.
GitHubActions Builds |
---|
Github Actions (Intellicode) |
---|
Docker Hub |
---|
CodeCov |
---|
SonarQube |
---|
NuGet |
---|