Am 01.10.2012 20:42, schrieb ArtemGr:
> Denis Loh <denis.loh@...> writes:
>> Hi,
>>
>> this sounds interesting. How do I use it? I guess, I just need to add
>> this to a small header and include it everywhere it shall count it?
> I'd think you need to instantiate it in the Tntnet components, e.g.
>
> index.ecpp
> <%pre>
> #include "request_counter.hpp"
> </%pre>
> <%request>
> request_counter_t countRequests;
> </%request>
>
> index2.ecpp
> <%pre>
> #include "request_counter.hpp"
> </%pre>
> <%cpp>
> request_counter_t countRequests;
> </%cpp>
>
> index3.cpp
> #include "request_counter.hpp"
> unsigned TntService::operator() (tnt::HttpRequest& request, tnt::HttpReply&
> reply, tnt::QueryParams& qparam) {
> request_counter_t countRequests;
>
Right. request-scope is fine also.
We have normally a file called global.ecpp, which contains global stuff
and is included using <%include>global.ecpp<%include>. There you could
also add these lines.
<%request scope="global"> is even better. Then it is shared between
subcomponents if you have any.
Tommi
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general