Cutelyst 0.8.0 - featuring better stats
Cutelyst the Qt Web Framework just got a new release!
With 0.8.0 some important bugs got fixed which will allow for the CMS/Blogger app CMlyst to get a new release soon. Besides bugs being fixed a class to take out stats from the application was created, Cutelyst::Stats matches what Catalyst::Stats does, and produces a similar output:
- There you have a box, and the time which each action took to complete, looking at the /End action it is clear that it took more time but most of the time was due it calling the Grantlee View.
- On the Request took: ... line there is the 1278.772/s value which means how many requests could be handled within a second, of course that value is for the exact same request and for the single core where it was run.
- The first line now shows which HTTP method was used, which resource the user wants and where the request came from.
All of that can and should be disabled on production by setting cutelyst.*.debug=false on the [Rules] section of the application ini file (--ini of uWSGI). Yeah this is new too :)
Speaking of debugging we now have more information about what user data was sent, if cutelyst.request.debug logging category is enabled you will see:
A similar output is printed for url query parameters and file uploads.
The HTTP/1.1 support for chunked responses was added, once c->response()->write(...) is called the response headers are send and a chunk is sent to the client, this is new and experimental, but worked without complaints from web browsers.
An easier way to declare action arguments or capture arguments was implemented, :AutoArgs and :AutoCaptureArgs, both are not present in Perl Catalyst because there is no way to introspect methods signature in the language, @_ can provide many things, but with Qt meta information we can see which types of arguments a method has as well as how many arguments:
C_ATTR(some_method, :Local :AutoArgs) void some_method(Context *c, const QString &year, const QString &month);
That will automatically capture two arguments matching an URL like "/some_method/2014/12".
Last the Headers class got many fixes and improvements such as striping the fragment due RFC 2616.
As always if you have questions show up in #cutelyst at freenode or send me a mail.
Download 0.8.0 here