summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-16 01:07:06 +0000
committernaga <naga@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-10-16 01:07:06 +0000
commit554d1f949776f7c87222ab5e20c273ea0d2b1890 (patch)
tree250ebeb731c507dadd928ba9d169d3f3ea753c3a
parent19676db52cf72306c130ea2240adbc1e5c9fd393 (diff)
downloadATCD-554d1f949776f7c87222ab5e20c273ea0d2b1890.tar.gz
Removed Naming service code from all the MT_Cubit files.
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp63
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.h12
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp5
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.h3
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp209
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h14
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp1
-rw-r--r--TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h2
-rwxr-xr-xTAO/performance-tests/Cubit/TAO/MT_Cubit/summarize10
9 files changed, 63 insertions, 256 deletions
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp
index 20def5cc37a..b17261727f2 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.cpp
@@ -111,50 +111,6 @@ Cubit_Task::initialize_orb (void)
GLOBALS::instance ()->ready_ = 1;
GLOBALS::instance ()->ready_cnd_.broadcast ();
}
-
- if (GLOBALS::instance ()->use_name_service == 0)
- return 0;
- // Initialize the TAO_Naming_Client.
- if (my_name_client_.init (orb_.in ()) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize "
- "the TAO_Naming_Client. \n"),
- -1);
-
- // Register the servant with the Naming Context....
- CosNaming::Name cubit_context_name (1);
- cubit_context_name.length (1);
- cubit_context_name[0].id = CORBA::string_dup ("MT_Cubit");
-
- TAO_TRY_ENV.clear ();
-
- CORBA::Object_var objref =
- this->my_name_client_->bind_new_context (cubit_context_name,
- TAO_TRY_ENV);
-
- if (TAO_TRY_ENV.exception() != 0)
- {
- CosNaming::NamingContext::AlreadyBound_ptr ex =
- CosNaming::NamingContext::AlreadyBound::_narrow
- (TAO_TRY_ENV.exception());
- if (ex != 0)
- {
- TAO_TRY_ENV.clear ();
- objref = this->my_name_client_->resolve
- (cubit_context_name, TAO_TRY_ENV);
- ACE_DEBUG ((LM_DEBUG,
- "NamingContext::AlreadyBound\n"));
- }
- else
- TAO_TRY_ENV.print_exception
- ("bind() Cubit context object\n");
- }
- TAO_CHECK_ENV;
-
- this->mt_cubit_context_ =
- CosNaming::NamingContext::_narrow (objref.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
}
TAO_CATCHANY
{
@@ -242,25 +198,6 @@ Cubit_Task::create_servants (void)
this->servants_iors_[i] =
ACE_OS::strdup (str.in ());
-
- // Register the servant with the Naming Context....
- CosNaming::Name cubit_name (1);
- cubit_name.length (1);
- cubit_name[0].id = CORBA::string_dup (buffer);
-
- if (CORBA::is_nil (this->mt_cubit_context_.in ()) == 0)
- {
- this->mt_cubit_context_->bind (cubit_name,
- cubit.in (),
- TAO_TRY_ENV);
- if (TAO_TRY_ENV.exception () != 0)
- TAO_TRY_ENV.print_exception
- ("Attempt to bind() a cubit object to the name service Failed!\n");
- else
- ACE_DEBUG ((LM_DEBUG,
- " (%t) Cubit object bound to the name \"%s\".\n",
- buffer));
- }
}
delete [] buffer;
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.h
index e503c112bb5..84100d9c182 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.h
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Cubit_Task.h
@@ -20,8 +20,6 @@
#include "ace/Task.h"
#include "ace/ARGV.h"
#include "tao/TAO.h"
-#include "orbsvcs/CosNamingC.h"
-#include "orbsvcs/Naming/Naming_Utils.h"
#include "cubit_i.h"
#include "Globals.h"
@@ -75,21 +73,11 @@ private:
CORBA::String *servants_iors_;
// IOR strings of the servants.
- //CosNaming::NamingContext_var naming_context_;
- // Object reference to the naming service.
-
u_int task_id_;
// ID used for naming service object name.
- CosNaming::NamingContext_var mt_cubit_context_;
- // Context where all MT Cubit objects will be created.
-
TAO_ORB_Manager orb_manager_;
// The TAO ORB Manager.
-
- TAO_Naming_Client my_name_client_;
- // An instance of the name client used for resolving the factory
- // objects.
};
#endif /* MT_CUBIT_TASK_H */
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp
index d155329c394..2086be559f2 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.cpp
@@ -6,7 +6,6 @@ Globals::Globals (void)
: ior_file (0),
base_port (0),
num_of_objs (2),
- use_name_service (1),
thread_per_rate (0),
use_multiple_priority (0),
ready_ (0),
@@ -39,9 +38,6 @@ Globals::parse_args (int argc, char *argv[])
case 'r':
thread_per_rate = 1;
break;
- case 's':
- use_name_service = 0;
- break;
case 'f':
ACE_NEW_RETURN (ior_file,
char[BUFSIZ],
@@ -63,7 +59,6 @@ Globals::parse_args (int argc, char *argv[])
default:
ACE_ERROR_RETURN ((LM_ERROR,
"usage: %s"
- " \t[-s Means NOT to use the name service] \n"
" \t[-p <port>]\n"
" \t[-h <my_hostname>]\n"
" \t[-t <num_objects>]\n"
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
index 69378ce0561..bf9fc4af03b 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Globals.h
@@ -135,9 +135,6 @@ public:
u_int num_of_objs;
// number of objects per servant thread.
- u_int use_name_service;
- // flag for usage of naming service.
-
u_int thread_per_rate;
// thread_per_rate test flag.
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
index 12428cd6855..5c7c74f2222 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.cpp
@@ -268,7 +268,6 @@ Client::Client (ACE_Thread_Manager *thread_manager,
timer_ (0),
frequency_ (0),
orb_ (0),
- naming_success_ (0),
latency_ (0),
argc_ (argc),
argv_ (argv)
@@ -368,7 +367,7 @@ Client::get_high_priority_jitter (void)
ACE_timer_t difference = *latency - average;
jitter += difference * difference;
- ACE_DEBUG ((LM_DEBUG, "high sample: %12.4f\n", *latency)); // ????
+ // ACE_DEBUG ((LM_DEBUG, "high sample: %12.4f\n", *latency)); // ????
if (stats.sample (ACE_round (*latency)) == -1)
ACE_DEBUG ((LM_DEBUG, "Error: stats.sample returned -1\n"));
@@ -429,7 +428,7 @@ Client::get_low_priority_jitter (void)
++number_of_samples;
ACE_timer_t difference = *latency - average;
jitter += difference * difference;
- ACE_DEBUG ((LM_DEBUG, "low sample: %12.4f\n", *latency)); // ????
+// ACE_DEBUG ((LM_DEBUG, "low sample: %12.4f\n", *latency)); // ????
stats.sample (ACE_round (*latency));
}
}
@@ -617,86 +616,6 @@ Client::init_orb (void)
}
int
-Client::get_cubit_from_naming (void)
-{
- CORBA::Object_var objref (0);
- ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->ts_->lock_, -1));
- TAO_TRY
- {
- // Initialize the naming services.
- if (my_name_client_.init (this->orb_.in ()) != 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%P|%t) Unable to initialize "
- "the TAO_Naming_Client. \n"),
- -1);
-
- // If the naming service was resolved successsfully ...
- if (!CORBA::is_nil (this->my_name_client_.get_context ()))
- {
- ACE_DEBUG ((LM_DEBUG,
- " (%t) ----- Using the NameService resolve() method"
- " to get cubit objects -----\n"));
-
- // Construct the key for the name service lookup.
- CosNaming::Name mt_cubit_context_name (1);
- mt_cubit_context_name.length (1);
- mt_cubit_context_name[0].id =
- CORBA::string_dup ("MT_Cubit");
-
- objref =
- this->my_name_client_->resolve (mt_cubit_context_name,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- this->mt_cubit_context_ =
- CosNaming::NamingContext::_narrow (objref.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
-
- char *buffer;
- int l = ACE_OS::strlen (this->ts_->key_) + 3;
- ACE_NEW_RETURN (buffer,
- char[l],
- -1);
- ACE_OS::sprintf (buffer,
- "%s%02d",
- (char *) this->ts_->key_,
- this->id_);
- // Construct the key for the name service lookup.
- CosNaming::Name cubit_name (1);
- cubit_name.length (1);
- cubit_name[0].id = CORBA::string_dup (buffer);
-
- objref = this->mt_cubit_context_->resolve (cubit_name,
- TAO_TRY_ENV);
- if (TAO_TRY_ENV.exception () != 0
- || CORBA::is_nil (objref.in ()))
- {
- ACE_DEBUG ((LM_DEBUG,
- " (%t) resolve() returned nil\n"));
- TAO_TRY_ENV.print_exception
- ("Attempt to resolve() a cubit object"
- "using the name service Failed!\n");
- }
- else
- {
- this->naming_success_ = 1;
- ACE_DEBUG ((LM_DEBUG,
- " (%t) Cubit object resolved to the name \"%s\".\n",
- buffer));
- }
- }
- }
- TAO_CATCHANY
- {
- TAO_TRY_ENV.print_exception ("Client::get_cubit_from_naming");
- return 1;
- }
- TAO_ENDTRY;
- return 0;
-}
-
-int
Client::get_cubit (void)
{
int result;
@@ -704,85 +623,73 @@ Client::get_cubit (void)
TAO_TRY
{
- if (this->ts_->use_name_service_ != 0)
- {
- result = this->get_cubit_from_naming ();
- if (result != 0)
- return result;
- }
- else
- {
- if (this->naming_success_ == 0)
- {
- char *my_ior =
- this->ts_->use_utilization_test_ == 1
- ? this->ts_->one_ior_
- : this->ts_->iors_[this->id_];
+ char *my_ior =
+ this->ts_->use_utilization_test_ == 1
+ ? this->ts_->one_ior_
+ : this->ts_->iors_[this->id_];
// If we are running the "1 to n" test make sure all low
// priority clients use only 1 low priority servant.
- if (this->id_ > 0
- && this->ts_->one_to_n_test_ == 1)
- my_ior = this->ts_->iors_[1];
-
- if (my_ior == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Must specify valid factory ior key with -k option,"
- " naming service, or ior filename\n"),
- -1);
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) The ior I'm using is: \"%s\"\n",
- my_ior));
+ if (this->id_ > 0
+ && this->ts_->one_to_n_test_ == 1)
+ my_ior = this->ts_->iors_[1];
- // If we are running the "1 to n" test make sure all low
- // priority clients use only 1 low priority servant.
- if (this->id_ > 0
- && this->ts_->one_to_n_test_ == 1)
- my_ior = this->ts_->iors_[1];
-
- if (my_ior == 0)
- ACE_ERROR_RETURN ((LM_ERROR,
- "Must specify valid factory ior key with -k option,"
- " naming service, or ior filename\n"),
- -1);
- objref = this->orb_->string_to_object (my_ior,
- TAO_TRY_ENV);
- ACE_DEBUG ((LM_DEBUG,
- "(%P|%t) String_to_object success\n"));
- TAO_CHECK_ENV;
- }
+ if (my_ior == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Must specify valid factory ior key with -k option,"
+ " naming service, or ior filename\n"),
+ -1);
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) The ior I'm using is: \"%s\"\n",
+ my_ior));
- if (CORBA::is_nil (objref.in ()))
- ACE_ERROR_RETURN ((LM_ERROR,
- " (%t) string_to_object or NameService->resolve() Failed!\n"),
- -1);
+ // If we are running the "1 to n" test make sure all low
+ // priority clients use only 1 low priority servant.
+ if (this->id_ > 0
+ && this->ts_->one_to_n_test_ == 1)
+ my_ior = this->ts_->iors_[1];
- // Narrow the CORBA::Object reference to the stub object,
- // checking the type along the way using _is_a.
- this->cubit_ = Cubit::_narrow (objref.in (),
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
+ if (my_ior == 0)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Must specify valid factory ior key with -k option,"
+ " naming service, or ior filename\n"),
+ -1);
+ objref = this->orb_->string_to_object (my_ior,
+ TAO_TRY_ENV);
+ ACE_DEBUG ((LM_DEBUG,
+ "(%P|%t) String_to_object success\n"));
+ TAO_CHECK_ENV;
- ACE_DEBUG ((LM_DEBUG,
- "(%t) _narrow done\n"));
+ if (CORBA::is_nil (objref.in ()))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ " (%t) string_to_object or NameService->resolve() Failed!\n"),
+ -1);
- if (CORBA::is_nil (this->cubit_))
- ACE_ERROR_RETURN ((LM_ERROR,
- "Create cubit failed\n"),
- 1);
+ // Narrow the CORBA::Object reference to the stub object,
+ // checking the type along the way using _is_a.
+ this->cubit_ = Cubit::_narrow (objref.in (),
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
- ACE_DEBUG ((LM_DEBUG,
- "(%t) Binding succeeded\n"));
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) _narrow done\n"));
- CORBA::String_var str =
- this->orb_->object_to_string (this->cubit_,
- TAO_TRY_ENV);
- TAO_CHECK_ENV;
+ if (CORBA::is_nil (this->cubit_))
+ ACE_ERROR_RETURN ((LM_ERROR,
+ "Create cubit failed\n"),
+ 1);
- ACE_DEBUG ((LM_DEBUG,
- "(%t) CUBIT OBJECT connected <%s>\n",
- str.in ()));
- }
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) Binding succeeded\n"));
+
+ CORBA::String_var str =
+ this->orb_->object_to_string (this->cubit_,
+ TAO_TRY_ENV);
+ TAO_CHECK_ENV;
+
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) CUBIT OBJECT connected <%s>\n",
+ str.in ()));
}
TAO_CATCHANY
{
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h
index f7f75a65b9c..63d97283372 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/Task_Client.h
@@ -27,8 +27,6 @@
#include "ace/High_Res_Timer.h"
#include "ace/Containers.h"
-#include "orbsvcs/CosNamingC.h"
-#include "orbsvcs/Naming/Naming_Utils.h"
#include "cubitC.h"
#include "cubit_i.h"
#include "Globals.h"
@@ -276,9 +274,6 @@ private:
int init_orb (void);
// initialize the ORB.
- int get_cubit_from_naming (void);
- // initialize the naming service.
-
void read_ior (void);
// reads the cubit ior from a file.
@@ -347,12 +342,6 @@ private:
u_int error_count_;
// number of calls that failed.
- CosNaming::NamingContext_var mt_cubit_context_;
- // Object reference to the cubit context "MT_Cubit".
-
- TAO_Naming_Client my_name_client_;
- // Naming Client intermediary to naming service stuff.
-
JITTER_ARRAY *my_jitter_array_;
// ACE Unbounded set holding the latency values for all the
// requests of this thread.
@@ -366,9 +355,6 @@ private:
CORBA::ORB_var orb_;
// ORB pointer.
- u_int naming_success_;
- // flag indicating the success of naming service.
-
ACE_timer_t latency_;
// aggregate latency of the requests.
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
index 7b2972d5922..441ac3022eb 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/client.cpp
@@ -656,7 +656,6 @@ Client_i::do_priority_inversion_test (void)
ACE_DEBUG ((LM_DEBUG,
"(%P|%t) <<<<<<< starting test on %D\n"));
GLOBALS::instance ()->num_of_objs = 1;
- GLOBALS::instance ()->use_name_service = 0;
for (int j = 0; j < this->argc_; j++)
if (ACE_OS::strcmp (this->argv_[j], "-u") == 0)
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h
index 226cc1a559e..b409b7d904e 100644
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/server.h
@@ -32,8 +32,6 @@
#include "ace/Log_Msg.h"
#include "ace/ARGV.h"
#include "ace/Sched_Params.h"
-#include "orbsvcs/CosNamingC.h"
-#include "orbsvcs/Naming/Naming_Utils.h"
// TAO includes.
#include "tao/corba.h"
diff --git a/TAO/performance-tests/Cubit/TAO/MT_Cubit/summarize b/TAO/performance-tests/Cubit/TAO/MT_Cubit/summarize
index 1ebebb59d47..1aaa1c36a1e 100755
--- a/TAO/performance-tests/Cubit/TAO/MT_Cubit/summarize
+++ b/TAO/performance-tests/Cubit/TAO/MT_Cubit/summarize
@@ -37,16 +37,16 @@ foreach $total_threads (sort {$a <=> $b} @total_threads) {
die "$0: unable to open \"client-${total_threads}.log\"\n";
while (<FILE>) {
if (/^High priority client latency : ([\d\.]+).*jitter: ([\d\.]+)/) {
- $high_latency = $1 * 1000;
- $high_jitter = $2 * 1000;
+ $high_latency = $1 ;
+ $high_jitter = $2 ;
} elsif (/^Low priority client latency : ([\d\.]+).*jitter: ([\d\.]+)/) {
- $low_latency = $1 * 1000;
- $low_jitter = $2 * 1000;
+ $low_latency = $1 ;
+ $low_jitter = $2 ;
last;
}
}
close FILE;
- printf " %3d %8d %8d %8d %8d\n",
+ printf " %3d %8.3f %8.3f %8.3f %8.3f\n",
$total_threads - 1, $high_latency, $high_jitter, $low_latency, $low_jitter;
}