Commits

Anonymous committed 8f1c89c

enable webmachine trace utility and include a few sample traces

  • Participants
  • Parent commits 2346bc4

Comments (0)

Files changed (7)

 The story of env_resource's development is available in five blog
 posts starting at http://blog.beerriot.com/2009/04/13/
 simple-webmachine-proper-http-resources/
+
+Sample Trace Resource
+---
+
+The Webmachine trace utility is available at
+http://localhost:8000/wmtrace/ while this application is running.
+
+Four example trace files have been included in the "traces" directory.
+They are named example-trace-CODE.wmtrace, where CODE is the HTTP
+status code the resource returned at the end of the request.
+
+The sample trace files were generated with the sampletrace_resource,
+which is included and exposed at http://localhost:8000/sampletrace
+That resource isn't good for much other than generating those simple
+examples, but I thought it best to include it for demonstration
+purposes.

File priv/dispatch.conf

 {["_env", env],  %% exposed at /_env/VARIABLE_NAME
  env_resource,   %% defined in env_resource.erl
  []}.            %% no configuration
+
+
+%% Webmachine Trace Utility
+%% These are static dispatch lines to enable the trace utility
+%% every time this application is started.
+{["wmtrace",'*'],          %% exposed at /wmtrace/*
+ wmtrace_resource,         %% defined in wmtrace_resource.erl
+                           %%   (included with webmachine)
+ [{trace_dir, "traces"}]}. %% trace files are in "traces" directory
+
+%% sampletrace is meant for nothing other than generating a few sample
+%% trace files.  It expects a "code" query parameter, specifying which
+%% response code you'd like.
+%% Current supported codes are: 200 (default), 404, 301, and 500
+{["sampletrace"],         
+ sampletrace_resource,
+ []}.

File src/sampletrace_resource.erl

+%% @author Bryan Fink
+%% @doc sampletrace_resource is intended to do nothing more than
+%%      generate a few sample trace files for experimenting with the
+%%      wmtrace utility.  As such, it has a fairly strange structure,
+%%      forcing itself through a few resource functions to make
+%%      webmachine generate requested status codes.
+%%
+%%      Make requests to this resource specifying a code with the
+%%      query parameter ?code=XXX, where XXX is one of
+%%      200, 301, 404, or 500
+%%
+%%      Hint: You can also generate a sample 400-code trace by
+%%      asking for an unsupported code.
+-module(sampletrace_resource).
+-export([init/1,
+         malformed_request/2,
+         resource_exists/2,
+         previously_existed/2,
+         moved_permanently/2,
+         to_html/2]).
+-include_lib("webmachine/include/webmachine.hrl").
+
+init(_) ->
+    {{trace, "traces"}, %% enable tracing, and store files
+                        %% in "traces" directory
+     undefined}.
+
+malformed_request(RD, undefined) ->
+    case wrq:get_qs_value("code", RD) of
+        "500"     -> {false, RD, sample500};
+        "404"     -> {false, RD, sample404};
+        "301"     -> {false, RD, sample301};
+        "200"     -> {false, RD, sample200};
+        undefined -> {false, RD, sample200};
+        Other ->
+            {true,
+             wrq:append_to_response_body(
+               ["Status Code ", Other, " is not supported."],
+               wrq:set_resp_header("Content-type",
+                                   "text/html",
+                                   RD)),
+             undefined}
+    end.
+
+resource_exists(RD, sample200)  -> {true,  RD, sample200};
+resource_exists(RD, Code)       -> {false, RD, Code}.
+
+previously_existed(RD, sample301)  -> {true,  RD, sample301};
+previously_existed(RD, sample404)  -> {false, RD, sample404}.
+
+moved_permanently(RD, sample301)  -> {{true, "/"}, RD, sample301}.
+
+to_html(RD, sample200) ->
+    {"<html><body>Hello!</body></html>", RD, sample200}.

File traces/example-trace-200.wmtrace

+{decision, v3b14}.
+{attempt, sampletrace_resource, init,
+ []}.
+{result, sampletrace_resource, init,
+ {{trace,"traces"},undefined}}.
+{decision, v3b13}.
+{attempt, sampletrace_resource, ping,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{result, sampletrace_resource, ping,
+ {pong,{wm_reqdata,'GET',
+                   {1,1},
+                   "127.0.0.1",[],"/sampletrace","/sampletrace",
+                   {dict,0,16,16,8,80,48,
+                         {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                         {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                   [],".",500,[],[],
+                   {3,
+                    {"user-agent",
+                     {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                     {"host",
+                      {'Host',"localhost:8000"},
+                      {"accept",{'Accept',"*/*"},nil,nil},
+                      nil},
+                     nil}},
+                   undefined,false,
+                   {0,nil},
+                   <<>>},
+       undefined}}.
+{decision, v3b13b}.
+{not_exported, sampletrace_resource, service_available,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b12}.
+{not_exported, sampletrace_resource, known_methods,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b11}.
+{not_exported, sampletrace_resource, uri_too_long,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b10}.
+{not_exported, sampletrace_resource, allowed_methods,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b9}.
+{attempt, sampletrace_resource, malformed_request,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{result, sampletrace_resource, malformed_request,
+ {false,{wm_reqdata,'GET',
+                    {1,1},
+                    "127.0.0.1",[],"/sampletrace","/sampletrace",
+                    {dict,0,16,16,8,80,48,
+                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                          {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                    [],".",500,[],[],
+                    {3,
+                     {"user-agent",
+                      {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                      {"host",
+                       {'Host',"localhost:8000"},
+                       {"accept",{'Accept',"*/*"},nil,nil},
+                       nil},
+                      nil}},
+                    undefined,false,
+                    {0,nil},
+                    <<>>},
+        sample200}}.
+{decision, v3b8}.
+{not_exported, sampletrace_resource, is_authorized,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3b7}.
+{not_exported, sampletrace_resource, forbidden,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3b6}.
+{not_exported, sampletrace_resource, valid_content_headers,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3b5}.
+{not_exported, sampletrace_resource, known_content_type,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3b4}.
+{not_exported, sampletrace_resource, valid_entity_length,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3b3}.
+{decision, v3c3}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3c4}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3d4}.
+{decision, v3e5}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample200]}.
+{decision, v3f6}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{decision, v3g7}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, variances,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{attempt, sampletrace_resource, resource_exists,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{result, sampletrace_resource, resource_exists,
+ {true,{wm_reqdata,'GET',
+                   {1,1},
+                   "127.0.0.1",[],"/sampletrace","/sampletrace",
+                   {dict,0,16,16,8,80,48,
+                         {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                         {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                   [],".",500,[],[],
+                   {3,
+                    {"user-agent",
+                     {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                     {"host",
+                      {'Host',"localhost:8000"},
+                      {"accept",{'Accept',"*/*"},nil,nil},
+                      nil},
+                     nil}},
+                   undefined,false,
+                   {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+                   <<>>},
+       sample200}}.
+{decision, v3g8}.
+{decision, v3h10}.
+{decision, v3i12}.
+{decision, v3l13}.
+{decision, v3m16}.
+{decision, v3n16}.
+{decision, v3o16}.
+{decision, v3o18}.
+{not_exported, sampletrace_resource, generate_etag,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, last_modified,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, expires,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{attempt, sampletrace_resource, to_html,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{result, sampletrace_resource, to_html,
+ {"<html><body>Hello!</body></html>",
+  {wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200}}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample200]}.
+{decision, v3o18b}.
+{not_exported, sampletrace_resource, multiple_choices,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<"<html><body>Hello!</body></html>">>},
+  sample200]}.
+{not_exported, sampletrace_resource, finish_request,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",200,[],[],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<"<html><body>Hello!</body></html>">>},
+  sample200]}.

File traces/example-trace-301.wmtrace

+{decision, v3b14}.
+{attempt, sampletrace_resource, init,
+ []}.
+{result, sampletrace_resource, init,
+ {{trace,"traces"},undefined}}.
+{decision, v3b13}.
+{attempt, sampletrace_resource, ping,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{result, sampletrace_resource, ping,
+ {pong,{wm_reqdata,'GET',
+                   {1,1},
+                   "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+                   {dict,0,16,16,8,80,48,
+                         {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                         {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                   [],".",500,[],
+                   [{"code","301"}],
+                   {3,
+                    {"user-agent",
+                     {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                     {"host",
+                      {'Host',"localhost:8000"},
+                      {"accept",{'Accept',"*/*"},nil,nil},
+                      nil},
+                     nil}},
+                   undefined,false,
+                   {0,nil},
+                   <<>>},
+       undefined}}.
+{decision, v3b13b}.
+{not_exported, sampletrace_resource, service_available,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b12}.
+{not_exported, sampletrace_resource, known_methods,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b11}.
+{not_exported, sampletrace_resource, uri_too_long,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b10}.
+{not_exported, sampletrace_resource, allowed_methods,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b9}.
+{attempt, sampletrace_resource, malformed_request,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{result, sampletrace_resource, malformed_request,
+ {false,{wm_reqdata,'GET',
+                    {1,1},
+                    "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+                    {dict,0,16,16,8,80,48,
+                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                          {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                    [],".",500,[],
+                    [{"code","301"}],
+                    {3,
+                     {"user-agent",
+                      {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                      {"host",
+                       {'Host',"localhost:8000"},
+                       {"accept",{'Accept',"*/*"},nil,nil},
+                       nil},
+                      nil}},
+                    undefined,false,
+                    {0,nil},
+                    <<>>},
+        sample301}}.
+{decision, v3b8}.
+{not_exported, sampletrace_resource, is_authorized,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3b7}.
+{not_exported, sampletrace_resource, forbidden,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3b6}.
+{not_exported, sampletrace_resource, valid_content_headers,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3b5}.
+{not_exported, sampletrace_resource, known_content_type,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3b4}.
+{not_exported, sampletrace_resource, valid_entity_length,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3b3}.
+{decision, v3c3}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3c4}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3d4}.
+{decision, v3e5}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample301]}.
+{decision, v3f6}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{decision, v3g7}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{not_exported, sampletrace_resource, variances,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{attempt, sampletrace_resource, resource_exists,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{result, sampletrace_resource, resource_exists,
+ {false,{wm_reqdata,'GET',
+                    {1,1},
+                    "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+                    {dict,0,16,16,8,80,48,
+                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                          {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                    [],".",500,[],
+                    [{"code","301"}],
+                    {3,
+                     {"user-agent",
+                      {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                      {"host",
+                       {'Host',"localhost:8000"},
+                       {"accept",{'Accept',"*/*"},nil,nil},
+                       nil},
+                      nil}},
+                    undefined,false,
+                    {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+                    <<>>},
+        sample301}}.
+{decision, v3h7}.
+{decision, v3i7}.
+{decision, v3k7}.
+{attempt, sampletrace_resource, previously_existed,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{result, sampletrace_resource, previously_existed,
+ {true,{wm_reqdata,'GET',
+                   {1,1},
+                   "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+                   {dict,0,16,16,8,80,48,
+                         {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                         {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                   [],".",500,[],
+                   [{"code","301"}],
+                   {3,
+                    {"user-agent",
+                     {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                     {"host",
+                      {'Host',"localhost:8000"},
+                      {"accept",{'Accept',"*/*"},nil,nil},
+                      nil},
+                     nil}},
+                   undefined,false,
+                   {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+                   <<>>},
+       sample301}}.
+{decision, v3k5}.
+{attempt, sampletrace_resource, moved_permanently,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301]}.
+{result, sampletrace_resource, moved_permanently,
+ {{true,"/"},
+  {wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample301}}.
+{not_exported, sampletrace_resource, finish_request,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=301",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",301,[],
+              [{"code","301"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {2,
+               {"content-type",
+                {"Content-Type","text/html"},
+                nil,
+                {"location",{"Location","/"},nil,nil}}},
+              <<>>},
+  sample301]}.

File traces/example-trace-404.wmtrace

+{decision, v3b14}.
+{attempt, sampletrace_resource, init,
+ []}.
+{result, sampletrace_resource, init,
+ {{trace,"traces"},undefined}}.
+{decision, v3b13}.
+{attempt, sampletrace_resource, ping,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{result, sampletrace_resource, ping,
+ {pong,{wm_reqdata,'GET',
+                   {1,1},
+                   "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+                   {dict,0,16,16,8,80,48,
+                         {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                         {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                   [],".",500,[],
+                   [{"code","404"}],
+                   {3,
+                    {"user-agent",
+                     {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                     {"host",
+                      {'Host',"localhost:8000"},
+                      {"accept",{'Accept',"*/*"},nil,nil},
+                      nil},
+                     nil}},
+                   undefined,false,
+                   {0,nil},
+                   <<>>},
+       undefined}}.
+{decision, v3b13b}.
+{not_exported, sampletrace_resource, service_available,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b12}.
+{not_exported, sampletrace_resource, known_methods,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b11}.
+{not_exported, sampletrace_resource, uri_too_long,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b10}.
+{not_exported, sampletrace_resource, allowed_methods,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{decision, v3b9}.
+{attempt, sampletrace_resource, malformed_request,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  undefined]}.
+{result, sampletrace_resource, malformed_request,
+ {false,{wm_reqdata,'GET',
+                    {1,1},
+                    "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+                    {dict,0,16,16,8,80,48,
+                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                          {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                    [],".",500,[],
+                    [{"code","404"}],
+                    {3,
+                     {"user-agent",
+                      {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                      {"host",
+                       {'Host',"localhost:8000"},
+                       {"accept",{'Accept',"*/*"},nil,nil},
+                       nil},
+                      nil}},
+                    undefined,false,
+                    {0,nil},
+                    <<>>},
+        sample404}}.
+{decision, v3b8}.
+{not_exported, sampletrace_resource, is_authorized,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3b7}.
+{not_exported, sampletrace_resource, forbidden,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3b6}.
+{not_exported, sampletrace_resource, valid_content_headers,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3b5}.
+{not_exported, sampletrace_resource, known_content_type,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3b4}.
+{not_exported, sampletrace_resource, valid_entity_length,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3b3}.
+{decision, v3c3}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3c4}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3d4}.
+{decision, v3e5}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {0,nil},
+              <<>>},
+  sample404]}.
+{decision, v3f6}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{decision, v3g7}.
+{not_exported, sampletrace_resource, content_types_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{not_exported, sampletrace_resource, encodings_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{not_exported, sampletrace_resource, charsets_provided,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{not_exported, sampletrace_resource, variances,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{attempt, sampletrace_resource, resource_exists,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{result, sampletrace_resource, resource_exists,
+ {false,{wm_reqdata,'GET',
+                    {1,1},
+                    "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+                    {dict,0,16,16,8,80,48,
+                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                          {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                    [],".",500,[],
+                    [{"code","404"}],
+                    {3,
+                     {"user-agent",
+                      {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                      {"host",
+                       {'Host',"localhost:8000"},
+                       {"accept",{'Accept',"*/*"},nil,nil},
+                       nil},
+                      nil}},
+                    undefined,false,
+                    {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+                    <<>>},
+        sample404}}.
+{decision, v3h7}.
+{decision, v3i7}.
+{decision, v3k7}.
+{attempt, sampletrace_resource, previously_existed,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",500,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<>>},
+  sample404]}.
+{result, sampletrace_resource, previously_existed,
+ {false,{wm_reqdata,'GET',
+                    {1,1},
+                    "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+                    {dict,0,16,16,8,80,48,
+                          {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                          {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+                    [],".",500,[],
+                    [{"code","404"}],
+                    {3,
+                     {"user-agent",
+                      {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                      {"host",
+                       {'Host',"localhost:8000"},
+                       {"accept",{'Accept',"*/*"},nil,nil},
+                       nil},
+                      nil}},
+                    undefined,false,
+                    {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+                    <<>>},
+        sample404}}.
+{decision, v3l7}.
+{not_exported, sampletrace_resource, finish_request,
+ [{wm_reqdata,'GET',
+              {1,1},
+              "127.0.0.1",[],"/sampletrace","/sampletrace?code=404",
+              {dict,0,16,16,8,80,48,
+                    {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
+                    {{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}},
+              [],".",404,[],
+              [{"code","404"}],
+              {3,
+               {"user-agent",
+                {'User-Agent',"curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3"},
+                {"host",
+                 {'Host',"localhost:8000"},
+                 {"accept",{'Accept',"*/*"},nil,nil},
+                 nil},
+                nil}},
+              undefined,false,
+              {1,{"content-type",{"Content-Type","text/html"},nil,nil}},
+              <<"<HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested document was not found on this server.<P><HR><ADDRESS>mochiweb+webmachine web server</ADDRESS></BODY></HTML>">>},
+  sample404]}.

File traces/example-trace-500.wmtrace

+{decision, v3b14}.
+{attempt, sampletrace_resource, init,
+ []}.
+{result, sampletrace_resource, init,