2 //=============================================================================
8 * @author Aniruddha Gokhale
10 //=============================================================================
14 #include "tao/debug.h"
15 #include "ace/Log_Msg.h"
23 delete [] this->elapsed_time_
;
27 Results::print_stats ()
37 if (TAO_debug_level
> 0 && this->error_count_
== 0)
39 //FUZZ: disable check_for_lack_ACE_OS
41 "Iteration\tReal time (msec)\tUser time (msec)"
42 "\tSystem time (msec)\n\n"));
43 //FUZZ: enable check_for_lack_ACE_OS
45 for (i
= 0; i
< this->call_count_
; i
++)
47 this->elapsed_time_
[i
].real_time
*= ACE_ONE_SECOND_IN_MSECS
;
48 this->elapsed_time_
[i
].user_time
*= ACE_ONE_SECOND_IN_MSECS
;
49 this->elapsed_time_
[i
].system_time
*= ACE_ONE_SECOND_IN_MSECS
;
50 avg_real_time
+= this->elapsed_time_
[i
].real_time
;
51 avg_user_time
+= this->elapsed_time_
[i
].user_time
;
52 avg_system_time
+= this->elapsed_time_
[i
].system_time
;
55 "%u\t\t%0.06f\t\t%0.06f\t\t%0.06f\n",
57 (this->elapsed_time_
[i
].real_time
< 0.0?
58 0.0:this->elapsed_time_
[i
].real_time
),
59 (this->elapsed_time_
[i
].user_time
< 0.0?
60 0.0:this->elapsed_time_
[i
].user_time
),
61 (this->elapsed_time_
[i
].system_time
< 0.0?
62 0.0:this->elapsed_time_
[i
].system_time
)));
66 avg_real_time
/= this->call_count_
;
67 avg_user_time
/= this->call_count_
;
68 avg_system_time
/= this->call_count_
;
69 cps
= 1000 / (avg_real_time
< 0.01 ? 0.01 : avg_real_time
);
72 "\n*=*=*=*=*= Average *=*=*=*=*=*=\n"
73 "\treal_time\t= %0.06f ms,\n"
74 "\tuser_time\t= %0.06f ms,\n"
75 "\tsystem_time\t= %0.06f ms\n"
76 "\t%0.00f calls/second\n"
77 "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=\n",
78 (avg_real_time
< 0.0? 0.0:avg_real_time
),
79 (avg_user_time
< 0.0? 0.0:avg_user_time
),
80 (avg_system_time
< 0.0? 0.0:avg_system_time
),
81 (cps
< 0.0? 0.0 : cps
)));
84 "\t%d calls, %d errors\n"
85 "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=\n",
89 else if (this->error_count_
!= 0)
92 "\tERROR %d faults in %d calls\n"
93 "*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=\n",
100 Results::print_exception (const char * /* call_name */)
102 //ACE_PRINT_EXCEPTION (call_name);
106 Results::start_timer ()
108 this->timer_
.start ();
112 Results::stop_timer ()
114 this->timer_
.stop ();
115 this->timer_
.elapsed_time (this->elapsed_time_
[this->call_count_
-1]);
119 Results::call_count ()
121 return this->call_count_
;
125 Results::call_count (CORBA::ULong c
)
127 this->call_count_
= c
;
131 Results::error_count ()
133 return this->error_count_
;
137 Results::error_count (CORBA::ULong c
)
139 this->error_count_
= c
;
143 Results::iterations (CORBA::ULong iters
)
145 this->elapsed_time_
= new ACE_Profile_Timer::ACE_Elapsed_Time
[iters
];