summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuangming <huangminghuang@users.noreply.github.com>2003-11-26 23:31:11 +0000
committerhuangming <huangminghuang@users.noreply.github.com>2003-11-26 23:31:11 +0000
commit0aaca0de46257b77fa4ea68257c31396341980cc (patch)
tree67f23795a234cdd8368834a9301c175c91a1486b
parent12a34501ee229a69c1bcf81067608d613b33ac2d (diff)
downloadATCD-0aaca0de46257b77fa4ea68257c31396341980cc.tar.gz
Add TimeLogger
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp3
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp4
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp21
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h13
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/RT_Task.h3
5 files changed, 42 insertions, 2 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp
index 81dda05ae1a..f16ee092955 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FTEC_Event_Channel_Impl.cpp
@@ -44,6 +44,8 @@ namespace {
ACE_ENV_ARG_DECL)
{
FTRTEC_TRACE("obtain_push_consumer_and_connect");
+ FTRTEC_LOGTIME("obtain_push_consumer_and_connect");
+
Request_Context_Repository().set_object_id(oid ACE_ENV_ARG_PARAMETER);
RtecEventChannelAdmin::ProxyPushConsumer_var consumer =
@@ -367,6 +369,7 @@ TAO_FTEC_Event_Channel_Impl::connect_push_supplier (
)
{
FTRTEC_TRACE("TAO_FTEC_Event_Channel_Impl::connect_push_supplier");
+ FTRTEC_LOGTIME("TAO_FTEC_Event_Channel_Impl::connect_push_supplier");
CORBA::Any_var any
= Request_Context_Repository().get_cached_result(ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN(0);
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp
index 70c495471ec..f57066f27d0 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FT_ProxyAdmin_T.cpp
@@ -3,6 +3,7 @@
#include "IOGR_Maker.h"
#include "Replication_Service.h"
#include "ace/Synch_T.h"
+#include "../Utils/Log.h"
template <class EC_PROXY_ADMIN, class Proxy,
class ProxyInterface, class State>
@@ -20,6 +21,7 @@ FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface,State>::obtain_proxy (
const FtRtecEventChannelAdmin::Operation& op
ACE_ENV_ARG_DECL)
{
+ FTRTEC_LOGTIME("FT_ProxyAdmin::obtain_proxy(op)");
Request_Context_Repository().set_object_id(op.object_id
ACE_ENV_ARG_PARAMETER);
@@ -51,6 +53,8 @@ template <class EC_PROXY_ADMIN, class Proxy,
typename FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::ProxyInterface_ptr
FT_ProxyAdmin<EC_PROXY_ADMIN, Proxy, ProxyInterface, State>::obtain_proxy (ACE_ENV_SINGLE_ARG_DECL)
{
+ FTRTEC_LOGTIME("FT_ProxyAdmin::obtain_proxy()");
+
CORBA::Any_var any = Request_Context_Repository().get_cached_result(ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_CHECK_RETURN(0);
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
index bff5e516714..8354004808c 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
@@ -21,6 +21,27 @@ namespace TAO_FTRTEC {
va_end(p);
}
}
+
+ char buffer [1024*100];
+ char* now=buffer;
+
+ TimeLogger::TimeLogger(const char* msg)
+ : msg_(msg)
+ {
+ start_time_ = ACE_OS::gettimeofday ();
+ }
+
+ TimeLogger::~TimeLogger()
+ {
+ ACE_Time_Value result = ACE_OS::gettimeofday () - start_time_;
+ int n = ACE_OS::snprintf(now, buffer-now, "%s %d\n", msg_, result.sec()*1000000+result.usec());
+ now+=n;
+ }
+
+ void TimeLogger::output()
+ {
+ ACE_DEBUG((LM_DEBUG, buffer));
+ }
#endif
}
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
index 0403b56bb74..553d602c6e9 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
@@ -26,6 +26,17 @@ namespace TAO_FTRTEC {
private:
const char* msg_;
};
+
+ class TAO_FtRtEvent_Export TimeLogger
+ {
+ public:
+ TimeLogger(const char* msg);
+ ~TimeLogger();
+ static void output();
+ private:
+ const char* msg_;
+ ACE_Time_Value start_time_;
+ };
/**
* A utility class for logging messages.
*/
@@ -42,7 +53,7 @@ namespace TAO_FTRTEC {
}
#define FTRTEC_TRACE(x) TAO_FTRTEC::Trace __ftrtec_trace_obj(x)
-
+#define FTRTEC_LOGTIME(x) TAO_FTRTEC::TimeLogger __ftrtec_time_logger(x)
#if defined(__ACE_INLINE__)
#include "Log.inl"
#endif /* __ACE_INLINE__ */
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/RT_Task.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/RT_Task.h
index c19543e6f11..35a9340f24b 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/RT_Task.h
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/RT_Task.h
@@ -10,10 +10,11 @@
//=============================================================================
#ifndef RT_TASK_H
#define RT_TASK_H
+#include "ftrtevent_export.h"
class ACE_Task_Base;
-class RT_Task
+class TAO_FtRtEvent_Export RT_Task
{
public:
static void set_current();