Sunday, July 7, 2013

Roundtripping the HTTP Flowchart

Webmachine hackers are familiar with a certain . Webmachine was designed as a .
It has long bugged many of the Webmachine hackers that this relationship is one-way, though. Webmachine was made from the graph, but the graph wasn’t made from Webmachine. I decided to change that in my evenings last week, while trying to take my mind off of testing.

This is a version of the HTTP flowchart that only a Webmachine hacker could love. It’s ugly and missing some information, but the important part is that it’s generated by parsing webmachine_decision_core.erl.
I’ve shared the code for generating this image in the . Make sure you have installed, then checkout that branch and run make graph && open docs/wdc_graph.png.
In addition to the PNG, you’ll also find a docs/wdc_graph.dot if you prefer to render to some other format.
If you’d really like to dig in, I suggest firing up an Erlang node and looking at the output of wdc_graph:parse("src/webmachine_decision_core.erl"):

[{v3b13, [ping], [v3b13b,503]},
{v3b13b,[service_available], [v3b12,503]},
{v3b12, [known_methods], [v3b11,501]},
{v3b11, [uri_too_long], [414,v3b10]},
{v3b10, [allowed_methods,'RESPOND'],[v3b9,405]},
{v3b9, [malformed_request], [400,v3b8]},
... - Full Post

No comments:

Post a Comment