summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-05-05 19:32:43 +0000
committerpradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-05-05 19:32:43 +0000
commitdf4165536a424f5775f40c2a896f499dcbc5e099 (patch)
tree9ae7cc92fd15770ae49f3602e49cee52fa84aac5
parent001a3d6818022ca13c3389d330a1df64a7d1e82f (diff)
downloadATCD-df4165536a424f5775f40c2a896f499dcbc5e099.tar.gz
*** empty log message ***
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp21
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp3
-rw-r--r--TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h2
4 files changed, 26 insertions, 3 deletions
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
index afb8a600721..4164a066b30 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.cpp
@@ -15,7 +15,7 @@
ACE_RCSID(RT_Notify, TAO_NS_Periodic_Consumer, "$id$")
TAO_NS_Periodic_Consumer::TAO_NS_Periodic_Consumer (void)
- :count_ (-1), max_count_ (-1), client_ (0), check_priority_ (0)
+ :count_ (-1), max_count_ (-1), load_ (0), client_ (0), check_priority_ (0)
{
}
@@ -125,7 +125,7 @@ TAO_NS_Periodic_Consumer::push_structured_event (const CosNotification::Structur
ACE_CHECK;
const CosNotification::PropertySeq& prop_seq = notification.header.variable_header;
-
+
if (this->count_ == -1)
{
if (TAO_debug_level > 0)
@@ -150,6 +150,13 @@ TAO_NS_Periodic_Consumer::push_structured_event (const CosNotification::Structur
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG, "(%P, %t) Setting Maxcount = %d\n", this->max_count_));
}
+ else if (ACE_OS::strcmp (prop_seq[i].name.in (), "Load") == 0)
+ {
+ prop_seq[i].value >>= this->load_;
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG, "(%P, %t) Setting Load = %d\n", this->load_));
+ }
}
this->stats_.init (this->max_count_);
@@ -239,6 +246,16 @@ TAO_NS_Periodic_Consumer::push_structured_event (const CosNotification::Structur
stats_.sample (send_time_hrtime, now);
+ // Eat CPU
+ static CORBA::ULong prime_number = 9619;
+
+ for (; this->load_ != 0; this->load_--)
+ ACE::is_prime (prime_number,
+ 2,
+ prime_number / 2);
+
+ // ---
+
if (++this->count_ >= this->max_count_ )
{
stats_.end_time (ACE_OS::gethrtime ());
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
index 08deba372b9..a32fba2854e 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Consumer.h
@@ -86,6 +86,9 @@ protected:
/// A filter might not allow some events to through. we can tell the consumer what to expect.
int max_count_;
+ /// The Load
+ CORBA::ULong load_;
+
/// Stats house keeping
Task_Stats stats_;
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp
index ea69a58065d..468a8e9911e 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.cpp
@@ -210,6 +210,9 @@ TAO_NS_Periodic_Supplier::handle_svc (ACE_ENV_SINGLE_ARG_DECL)
buffer <<= this->iter_;
zeroth_event.opt_header ("MaxCount", buffer);
+ buffer <<= this->load_;
+ zeroth_event.opt_header ("Load", buffer);
+
if (TAO_debug_level > 0)
ACE_DEBUG ((LM_DEBUG, "(%P, %t) Supplier (%s) sending event 0th event\n"));
diff --git a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h
index febb384a070..ea5be47d272 100644
--- a/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h
+++ b/TAO/orbsvcs/tests/Notify/lib/Periodic_Supplier.h
@@ -105,7 +105,7 @@ protected:
int iter_;
/// A load factor supplied to each Job.
- int load_;
+ CORBA::ULong load_;
/// Stats house keeping
Task_Stats stats_;