Mikołaj Koziarkiewicz

(See the previous blog entry to learn about Travesty in general)

The probably most important addition is preliminary typed diagram/graph support.

You need to add a bit of boilerplate to make it possible, but that just boils down to importing net.mikolak.travesty.registry._ and using either the .register or .↓ extension methods on your stages.

For example, this:

import net.mikolak.travesty
import net.mikolak.travesty.OutputFormat
import registry._ //adds special .↓ and .register methods to stages

val graph = Source.single("1").↓.via(Flow[String].map(_.toInt).↓).to(Sink.seq)

//render as image to file, PNG is supported as well
travesty.toFile(graph, OutputFormat.SVG)("/tmp/stream.svg")

Generates a diagram with appropriate element types:

travesty example typed graph

Another major change is the ability to select which Graphviz engine is used. Specifically, if you have Graphviz installed on the target machine, you can add an application.conf with:

travesty {
    engines = [CommandLine]

for a 10x+ speedup!

0.8 also features a fix for the Transform bug, and support for Akka 2.5.8, as well as 2.5.9 .

Hop onto the PROJECT PAGE for download and usage instructions!

Happy diagramming!

Mikołaj Koziarkiewicz


Travesty is a Scala library for doing two things with Akka Streams:

  • generating (untyped) structural diagrams of your Akka Streams, both as graphics and text (the latter useful for logging).

  • generating Tinkerpop 3 / Gremlin graph data structures - usable for e.g. writing tests that check stage sequencing in dynamically constructed Streams.

As you can imagine, I’ve originally developed this library with the growing stream structure of the "Akka Streams meets LibGDX" blogpost series. Here’s how the diagram for the current structure looks like:

travesty example graph

Where to get it?

Head over to the GitHub repo, where you’ll find installation and usage instructions.