[Boost-bugs] [Boost C++ Libraries] #3850: [Boost.tracer] library request

Subject: [Boost-bugs] [Boost C++ Libraries] #3850: [Boost.tracer] library request
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-01-19 23:41:40


#3850: [Boost.tracer] library request
---------------------------------+------------------------------------------
 Reporter: achinkoff@… | Owner:
     Type: Feature Requests | Status: new
Milestone: Boost 1.42.0 | Component: None
  Version: Boost 1.41.0 | Severity: Cosmetic
 Keywords: tracer |
---------------------------------+------------------------------------------
 [Boost.tracer] library request is founded on a desire to
 trace some statistics about program execution.

 The sample program below demonstrates these statistics.

 Sample program file:


 {{{
 #include <tracer.h>
 void foo()
 {
     TRACE_LIFETIME;
     usleep(rand() % 100000);
 }
 int main()
 {
     TRACE_LIFETIME;
     for(int i = 0; i < 100; ++i)
         foo();
 }

 }}}

 Produced log file:


 {{{
 All the program time: 05265686 us (micro secs)

 TRACE POINT:
  Function: int main()
  Calls: 0000000001 times
  Average T between calls: 0000000000 us
  Average life T: 0005264459 us
  File: main.cpp
  Line: 00000009

 TRACE POINT:
  Function: void foo()
  Calls: 0000000100 times
  Average T between calls: 0000051665 us
  Average life T: 0000052606 us
  File: main.cpp
  Line: 00000004

 }}}

 Comment:

 TRACE_LIFETIME is a MACRO that traces some scope statistics, namely:
 [[BR]]
 "Function" - the function name where the scope is;
 [[BR]]
 "Calls" - number of entries into this scope;
 [[BR]]
 "Average T between calls" - average time period between "Calls";
 [[BR]]
 "Average life T" - average time spent in this scope.

 Conclusion:

 I think it is reasonable to introduce this trace functionality into
 (for example) boost::tracer namespace.
 I had wrote tracer.h and tracer.cpp source files and
 I wish Boost community to consider them.

 Thank You.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3850>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:02 UTC