summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhuangming <huangminghuang@users.noreply.github.com>2003-12-07 22:39:58 +0000
committerhuangming <huangminghuang@users.noreply.github.com>2003-12-07 22:39:58 +0000
commit5de51b5dccf2b7034c60f3fd8dfefcacb0d64fb8 (patch)
treeb28b1e3802d97cfec3f082e60b6a4f520f3e3a7c
parent05884cca895ff4ca8042fcf614a76165dea9b404 (diff)
downloadATCD-5de51b5dccf2b7034c60f3fd8dfefcacb0d64fb8.tar.gz
*** empty log message ***
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp12
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp6
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp15
-rw-r--r--TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h15
4 files changed, 38 insertions, 10 deletions
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp
index b37a1e050b4..dfb8c544e74 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/EventChannel/FtEventServiceInterceptor.cpp
@@ -205,6 +205,9 @@ ACE_THROW_SPEC ((CORBA::SystemException))
{
}
+TAO_FTRTEC::TimeLogger time_logger;
+char msg_buf[512];
+
void
FtEventServiceInterceptor::receive_request_service_contexts (
PortableInterceptor::ServerRequestInfo_ptr ri
@@ -212,6 +215,8 @@ FtEventServiceInterceptor::receive_request_service_contexts (
ACE_THROW_SPEC ((CORBA::SystemException,
PortableInterceptor::ForwardRequest))
{
+ time_logger.start();
+
ACE_TRY_EX(block1) {
FT::FTRequestServiceContext ft_request_service_context;
IOP::ServiceContext_var service_context;
@@ -260,6 +265,10 @@ FtEventServiceInterceptor::receive_request_service_contexts (
Request_Context_Repository().set_sequence_number(ri, sequence_no
ACE_ENV_ARG_PARAMETER);
ACE_TRY_CHECK_EX(block1);
+ ACE_OS::snprintf(msg_buf, 512, " Client_Id = %d, seq_no = %d "
+ ,ft_request_service_context.client_id.in(), sequence_no);
+ time_logger.set_message(msg_buf);
+
}
ACE_CATCH (CORBA::BAD_PARAM, ex) {
}
@@ -304,6 +313,9 @@ FtEventServiceInterceptor::send_reply (PortableInterceptor::ServerRequestInfo_pt
request_table_.update(ft_request_service_context.client_id.in(),
ft_request_service_context.retention_id,
*(ri->result()) );
+
+ time_logger.stop();
+ time_logger.output();
}
void
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
index 98fd1608b38..eff7cc8e77e 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/FTEC_Gateway.cpp
@@ -139,9 +139,9 @@ RtecEventChannelAdmin::EventChannel_ptr
FTEC_Gateway::activate(PortableServer::POA_ptr poa ACE_ENV_ARG_DECL)
{
// preallocation connections
- CORBA::PolicyList_var pols;
- impl_->ftec->_validate_connection (pols.out () ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN(0);
+ //CORBA::PolicyList_var pols;
+ //impl_->ftec->_validate_connection (pols.out () ACE_ENV_ARG_PARAMETER);
+ //ACE_CHECK_RETURN(0);
PortableServer::IdUniquenessPolicy_var id_uniqueness_policy =
poa->create_id_uniqueness_policy(PortableServer::MULTIPLE_ID
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
index 077ca0b1120..30aa40a239c 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.cpp
@@ -25,20 +25,24 @@ namespace TAO_FTRTEC {
char buffer [1024*100];
char* now=buffer;
- TimeLogger::TimeLogger(const char* msg)
- : msg_(msg)
+ void TimeLogger::set_message(const char* msg)
+ {
+ msg_ = msg;
+ }
+
+ void TimeLogger::start()
{
start_time_ = ACE_OS::gettimeofday ();
}
- TimeLogger::~TimeLogger()
+ void TimeLogger::stop()
{
ACE_Time_Value stop = ACE_OS::gettimeofday ();
ACE_Time_Value result = stop - start_time_;
int time_in_usec = result.sec()*1000000+result.usec();
int n = ACE_OS::snprintf(now, buffer-now+sizeof(buffer),
- "%s %d , start = %d.%d, stop = %d.%d\n",
+ "%s %d , start = %d.%10d, stop = %d.%10d\n",
msg_, time_in_usec, start_time_.sec(), start_time_.usec(),
stop.sec(), stop.usec());
now+=n;
@@ -47,7 +51,10 @@ namespace TAO_FTRTEC {
void TimeLogger::output()
{
ACE_DEBUG((LM_DEBUG, buffer));
+ buffer[0] = '\0';
+ now = buffer;
}
+
#endif
}
diff --git a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
index 078c625e144..9b55041d3d8 100644
--- a/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
+++ b/TAO/orbsvcs/orbsvcs/FtRtEvent/Utils/Log.h
@@ -30,13 +30,22 @@ namespace TAO_FTRTEC {
class TAO_FtRtEvent_Export TimeLogger
{
public:
- TimeLogger(const char* msg);
- ~TimeLogger();
+ void set_message(const char* msg);
+ void start();
+ void stop();
static void output();
private:
const char* msg_;
ACE_Time_Value start_time_;
};
+
+ class TAO_FtRtEvent_Export TimeAutoLogger : public TimeLogger
+ {
+ public:
+ TimeAutoLogger(const char* msg) { set_message(msg); start(); }
+ ~TimeAutoLogger() { stop(); }
+ };
+
/**
* A utility class for logging messages.
*/
@@ -54,7 +63,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)
+#define FTRTEC_LOGTIME(x) TAO_FTRTEC::TimeAutoLogger __ftrtec_time_logger(x)
#if defined(__ACE_INLINE__)
#include "Log.inl"
#endif /* __ACE_INLINE__ */