summaryrefslogtreecommitdiff
path: root/performance-tests
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-14 03:07:44 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-06-14 03:07:44 +0000
commit60400cb9427ed72f1f7b4d339bd144e7f06c3dd8 (patch)
tree39b5024c102fd79558db8c6660fceba127d4546e /performance-tests
parentbb0758c1134cd6a75eb2e50db91b22645edc0c13 (diff)
downloadATCD-60400cb9427ed72f1f7b4d339bd144e7f06c3dd8.tar.gz
Added Makefiles, fixed some problems with shutdown messages
Diffstat (limited to 'performance-tests')
-rw-r--r--performance-tests/Server_Concurrency/Latency_Stats.h16
-rw-r--r--performance-tests/Server_Concurrency/Leader_Follower/Makefile33
-rw-r--r--performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp6
-rw-r--r--performance-tests/Server_Concurrency/Makefile20
-rw-r--r--performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile164
-rw-r--r--performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp57
6 files changed, 258 insertions, 38 deletions
diff --git a/performance-tests/Server_Concurrency/Latency_Stats.h b/performance-tests/Server_Concurrency/Latency_Stats.h
index f64aa1fd67b..4a566fb312c 100644
--- a/performance-tests/Server_Concurrency/Latency_Stats.h
+++ b/performance-tests/Server_Concurrency/Latency_Stats.h
@@ -34,16 +34,16 @@ Latency_Stats::Latency_Stats (void)
inline void
Latency_Stats::sample (ACE_hrtime_t sample)
{
- this->sum_ += sample;
+ this->sum_ += sample;
this->sum2_ += sample * sample;
if (this->n_ == 0)
{
this->min_ = sample;
this->max_ = sample;
}
- else if (this->min_ > sample)
+ if (this->min_ > sample)
this->min_ = sample;
- else if (this->max_ < sample)
+ if (this->max_ < sample)
this->max_ = sample;
this->n_++;
}
@@ -79,7 +79,11 @@ Latency_Stats::accumulate (const Latency_Stats& rhs)
if (this->n_ == 0)
{
- *this = rhs;
+ this->n_ = rhs.n_;
+ this->min_ = rhs.min_;
+ this->max_ = rhs.max_;
+ this->sum_ = rhs.sum_;
+ this->sum2_ = rhs.sum2_;
return;
}
@@ -88,9 +92,9 @@ Latency_Stats::accumulate (const Latency_Stats& rhs)
if (this->max_ < rhs.max_)
this->max_ = rhs.max_;
- this->sum_ += rhs.sum_;
+ this->sum_ += rhs.sum_;
this->sum2_ += rhs.sum2_;
- this->n_ += rhs.n_;
+ this->n_ += rhs.n_;
}
inline void
diff --git a/performance-tests/Server_Concurrency/Leader_Follower/Makefile b/performance-tests/Server_Concurrency/Leader_Follower/Makefile
new file mode 100644
index 00000000000..7c0586fafa5
--- /dev/null
+++ b/performance-tests/Server_Concurrency/Leader_Follower/Makefile
@@ -0,0 +1,33 @@
+#
+# $Id$
+#
+
+#----------------------------------------------------------------------------
+# Local macros
+#----------------------------------------------------------------------------
+
+BIN = leader_follower
+
+FILES = $(BIN)
+LSRC = $(addsuffix .cpp,$(FILES))
+LOBJ = $(addsuffix .o,$(FILES))
+CPPFLAGS += -I..
+
+BUILD = $(VOBJS) $(VBIN)
+
+#----------------------------------------------------------------------------
+# Include macros and targets
+#----------------------------------------------------------------------------
+
+include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
+include $(ACE_ROOT)/include/makeinclude/macros.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
+
+#----------------------------------------------------------------------------
+# Dependencies
+#----------------------------------------------------------------------------
+
diff --git a/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp b/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp
index 0e208c731a3..f19b7385c34 100644
--- a/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp
+++ b/performance-tests/Server_Concurrency/Leader_Follower/leader_follower.cpp
@@ -130,15 +130,15 @@ Leader_Follower_Task::svc (void)
this->condition_.signal ();
}
- // Record time to wake up follower.
- this->stats_.sample (ACE_OS::gethrtime () - start_of_burst);
-
if (exit_loop)
{
break;
}
else
{
+ // Record time to wake up follower.
+ this->stats_.sample (ACE_OS::gethrtime () - start_of_burst);
+
//
// Process message here.
//
diff --git a/performance-tests/Server_Concurrency/Makefile b/performance-tests/Server_Concurrency/Makefile
new file mode 100644
index 00000000000..f12b17e7a0e
--- /dev/null
+++ b/performance-tests/Server_Concurrency/Makefile
@@ -0,0 +1,20 @@
+#
+# $Id$
+#
+
+#----------------------------------------------------------------------------
+# Local macros
+#----------------------------------------------------------------------------
+
+DIRS = Queue_Based_Workers \
+ Leader_Follower
+
+#----------------------------------------------------------------------------
+# Include macros and targets
+#----------------------------------------------------------------------------
+
+include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
+include $(ACE_ROOT)/include/makeinclude/macros.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU
diff --git a/performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile b/performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile
new file mode 100644
index 00000000000..689bfb40dd5
--- /dev/null
+++ b/performance-tests/Server_Concurrency/Queue_Based_Workers/Makefile
@@ -0,0 +1,164 @@
+#
+# $Id$
+#
+
+#----------------------------------------------------------------------------
+# Local macros
+#----------------------------------------------------------------------------
+
+BIN = workers
+
+FILES = $(BIN)
+PSRC = $(addsuffix .cpp,$(FILES))
+LOBJ = $(addsuffix .o,$(FILES))
+CPPFLAGS += -I..
+
+BUILD = $(VOBJS) $(VBIN)
+
+#----------------------------------------------------------------------------
+# Include macros and targets
+#----------------------------------------------------------------------------
+
+include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU
+include $(ACE_ROOT)/include/makeinclude/macros.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.common.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU
+include $(ACE_ROOT)/include/makeinclude/rules.local.GNU
+
+#----------------------------------------------------------------------------
+# Dependencies
+#----------------------------------------------------------------------------
+
+# DO NOT DELETE THIS LINE -- g++dep uses it.
+# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
+
+.obj/workers.o .obj/workers.so .shobj/workers.o .shobj/workers.so: workers.cpp \
+ $(ACE_ROOT)/ace/Task.h \
+ $(ACE_ROOT)/ace/Service_Object.h \
+ $(ACE_ROOT)/ace/Shared_Object.h \
+ $(ACE_ROOT)/ace/ACE.h \
+ $(ACE_ROOT)/ace/OS.h \
+ $(ACE_ROOT)/ace/inc_user_config.h \
+ $(ACE_ROOT)/ace/config-sunos5.5.h \
+ $(ACE_ROOT)/ace/streams.h \
+ $(ACE_ROOT)/ace/Basic_Types.h \
+ $(ACE_ROOT)/ace/Basic_Types.i \
+ $(ACE_ROOT)/ace/Trace.h \
+ $(ACE_ROOT)/ace/OS.i \
+ $(ACE_ROOT)/ace/Log_Msg.h \
+ $(ACE_ROOT)/ace/Log_Record.h \
+ $(ACE_ROOT)/ace/ACE.i \
+ $(ACE_ROOT)/ace/Log_Priority.h \
+ $(ACE_ROOT)/ace/Log_Record.i \
+ $(ACE_ROOT)/ace/Shared_Object.i \
+ $(ACE_ROOT)/ace/Event_Handler.h \
+ $(ACE_ROOT)/ace/Event_Handler.i \
+ $(ACE_ROOT)/ace/Service_Object.i \
+ $(ACE_ROOT)/ace/Thread_Manager.h \
+ $(ACE_ROOT)/ace/Thread.h \
+ $(ACE_ROOT)/ace/Thread.i \
+ $(ACE_ROOT)/ace/Synch.h \
+ $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \
+ $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \
+ $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \
+ $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \
+ $(ACE_ROOT)/ace/Synch.i \
+ $(ACE_ROOT)/ace/Synch_T.h \
+ $(ACE_ROOT)/ace/Synch_T.i \
+ $(ACE_ROOT)/ace/Atomic_Op.i \
+ $(ACE_ROOT)/ace/Synch_T.cpp \
+ $(ACE_ROOT)/ace/Containers.h \
+ $(ACE_ROOT)/ace/Malloc_Base.h \
+ $(ACE_ROOT)/ace/Containers.i \
+ $(ACE_ROOT)/ace/Containers_T.h \
+ $(ACE_ROOT)/ace/Containers_T.i \
+ $(ACE_ROOT)/ace/Containers_T.cpp \
+ $(ACE_ROOT)/ace/Malloc.h \
+ $(ACE_ROOT)/ace/Malloc.i \
+ $(ACE_ROOT)/ace/Malloc_T.h \
+ $(ACE_ROOT)/ace/Free_List.h \
+ $(ACE_ROOT)/ace/Free_List.i \
+ $(ACE_ROOT)/ace/Free_List.cpp \
+ $(ACE_ROOT)/ace/Malloc_T.i \
+ $(ACE_ROOT)/ace/Malloc_T.cpp \
+ $(ACE_ROOT)/ace/Memory_Pool.h \
+ $(ACE_ROOT)/ace/Signal.h \
+ $(ACE_ROOT)/ace/Signal.i \
+ $(ACE_ROOT)/ace/Object_Manager.h \
+ $(ACE_ROOT)/ace/Object_Manager.i \
+ $(ACE_ROOT)/ace/Managed_Object.h \
+ $(ACE_ROOT)/ace/Managed_Object.i \
+ $(ACE_ROOT)/ace/Managed_Object.cpp \
+ $(ACE_ROOT)/ace/Mem_Map.h \
+ $(ACE_ROOT)/ace/Mem_Map.i \
+ $(ACE_ROOT)/ace/Memory_Pool.i \
+ $(ACE_ROOT)/ace/Thread_Manager.i \
+ $(ACE_ROOT)/ace/Task.i \
+ $(ACE_ROOT)/ace/Task_T.h \
+ $(ACE_ROOT)/ace/Message_Queue.h \
+ $(ACE_ROOT)/ace/Message_Block.h \
+ $(ACE_ROOT)/ace/Message_Block.i \
+ $(ACE_ROOT)/ace/Message_Block_T.h \
+ $(ACE_ROOT)/ace/Message_Block_T.i \
+ $(ACE_ROOT)/ace/Message_Block_T.cpp \
+ $(ACE_ROOT)/ace/IO_Cntl_Msg.h \
+ $(ACE_ROOT)/ace/Message_Queue_T.h \
+ $(ACE_ROOT)/ace/Message_Queue_T.i \
+ $(ACE_ROOT)/ace/Message_Queue_T.cpp \
+ $(ACE_ROOT)/ace/Strategies.h \
+ $(ACE_ROOT)/ace/Strategies_T.h \
+ $(ACE_ROOT)/ace/Service_Config.h \
+ $(ACE_ROOT)/ace/SString.h \
+ $(ACE_ROOT)/ace/SString.i \
+ $(ACE_ROOT)/ace/Service_Config.i \
+ $(ACE_ROOT)/ace/Reactor.h \
+ $(ACE_ROOT)/ace/Handle_Set.h \
+ $(ACE_ROOT)/ace/Handle_Set.i \
+ $(ACE_ROOT)/ace/Timer_Queue.h \
+ $(ACE_ROOT)/ace/Timer_Queue_T.h \
+ $(ACE_ROOT)/ace/Timer_Queue_T.i \
+ $(ACE_ROOT)/ace/Timer_Queue_T.cpp \
+ $(ACE_ROOT)/ace/Reactor.i \
+ $(ACE_ROOT)/ace/Reactor_Impl.h \
+ $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \
+ $(ACE_ROOT)/ace/Synch_Options.h \
+ $(ACE_ROOT)/ace/Synch_Options.i \
+ $(ACE_ROOT)/ace/Hash_Map_Manager.h \
+ $(ACE_ROOT)/ace/Functor.h \
+ $(ACE_ROOT)/ace/Functor.i \
+ $(ACE_ROOT)/ace/Functor_T.h \
+ $(ACE_ROOT)/ace/Functor_T.i \
+ $(ACE_ROOT)/ace/Functor_T.cpp \
+ $(ACE_ROOT)/ace/Hash_Map_Manager.i \
+ $(ACE_ROOT)/ace/Hash_Map_Manager_T.h \
+ $(ACE_ROOT)/ace/Hash_Map_Manager_T.i \
+ $(ACE_ROOT)/ace/Hash_Map_Manager_T.cpp \
+ $(ACE_ROOT)/ace/Strategies_T.i \
+ $(ACE_ROOT)/ace/Strategies_T.cpp \
+ $(ACE_ROOT)/ace/Service_Repository.h \
+ $(ACE_ROOT)/ace/Service_Types.h \
+ $(ACE_ROOT)/ace/Service_Types.i \
+ $(ACE_ROOT)/ace/Service_Repository.i \
+ $(ACE_ROOT)/ace/WFMO_Reactor.h \
+ $(ACE_ROOT)/ace/WFMO_Reactor.i \
+ $(ACE_ROOT)/ace/Strategies.i \
+ $(ACE_ROOT)/ace/Message_Queue.i \
+ $(ACE_ROOT)/ace/Task_T.i \
+ $(ACE_ROOT)/ace/Task_T.cpp \
+ $(ACE_ROOT)/ace/Module.h \
+ $(ACE_ROOT)/ace/Module.i \
+ $(ACE_ROOT)/ace/Module.cpp \
+ $(ACE_ROOT)/ace/Stream_Modules.h \
+ $(ACE_ROOT)/ace/Stream_Modules.i \
+ $(ACE_ROOT)/ace/Stream_Modules.cpp \
+ $(ACE_ROOT)/ace/Get_Opt.h \
+ $(ACE_ROOT)/ace/Get_Opt.i \
+ $(ACE_ROOT)/ace/High_Res_Timer.h \
+ $(ACE_ROOT)/ace/High_Res_Timer.i \
+ $(ACE_ROOT)/ace/Sched_Params.h \
+ $(ACE_ROOT)/ace/Sched_Params.i \
+ ../Latency_Stats.h
+
+# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
diff --git a/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp b/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp
index ad32b878b38..7296b78f653 100644
--- a/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp
+++ b/performance-tests/Server_Concurrency/Queue_Based_Workers/workers.cpp
@@ -72,16 +72,8 @@ Worker_Task::svc (void)
-1);
}
- Message_Block *message_block =
- ACE_dynamic_cast (Message_Block *, mb);
-
- // Record arrival time.
- this->stats_.sample (ACE_OS::gethrtime () - message_block->start_of_burst_);
-
ACE_Message_Block::ACE_Message_Type message_type =
- message_block->msg_type ();
-
- message_block->release ();
+ mb->msg_type ();
// If STOP message, break loop and end the task.
if (message_type == ACE_Message_Block::MB_STOP)
@@ -93,31 +85,38 @@ Worker_Task::svc (void)
this->messages_dequeued_));
}
+ mb->release ();
break;
}
- else
- {
- // Counter.
- ++this->messages_dequeued_;
- if (debug)
- {
- ACE_DEBUG ((LM_DEBUG,
- "(%t) dequeued its %d message\n",
- this->messages_dequeued_));
- }
+ Message_Block *message_block =
+ ACE_dynamic_cast (Message_Block *, mb);
- //
- // Process message here.
- //
+ // Record arrival time.
+ this->stats_.sample (ACE_OS::gethrtime () - message_block->start_of_burst_);
- for (int j = 0; j < message_size; ++j)
- {
- // Eat a little CPU
- /* takes about 40.2 usecs on a 167 MHz Ultra2 */
- u_long n = 1279UL;
- ACE::is_prime (n, 2, n / 2);
- }
+ mb->release ();
+
+ // Counter.
+ ++this->messages_dequeued_;
+
+ if (debug)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ "(%t) dequeued its %d message\n",
+ this->messages_dequeued_));
+ }
+
+ //
+ // Process message here.
+ //
+
+ for (int j = 0; j < message_size; ++j)
+ {
+ // Eat a little CPU
+ /* takes about 40.2 usecs on a 167 MHz Ultra2 */
+ u_long n = 1279UL;
+ ACE::is_prime (n, 2, n / 2);
}
}