2 // Option manager for performance tests.
4 #ifndef _PERFORMANCE_TEST_OPTIONS_H
5 #define _PERFORMANCE_TEST_OPTIONS_H
7 #include "ace/config-all.h"
9 #if !defined (ACE_LACKS_PRAGMA_ONCE)
11 #endif /* ACE_LACKS_PRAGMA_ONCE */
13 #include "ace/Profile_Timer.h"
14 #include "ace/Log_Msg.h"
15 #include "ace/Thread_Manager.h"
16 #include "ace/Atomic_Op.h"
17 #include "ace/svc_export.h"
19 #if defined (ACE_HAS_THREADS)
21 class ACE_Svc_Export Performance_Test_Options
24 Performance_Test_Options ();
25 void parse_args (int argc
, ACE_TCHAR
*argv
[]);
32 void thr_count (size_t count
);
35 void pipe_addr (ACE_TCHAR pipe
[]);
36 ACE_TCHAR
*pipe_addr ();
38 void mapped_file (ACE_TCHAR filename
[]);
39 ACE_TCHAR
*mapped_file ();
41 void service_entry (ACE_TCHAR
*service_entry
);
42 ACE_TCHAR
*service_entry ();
44 void sleep_time (size_t count
);
47 void logical_connections (size_t count
);
48 size_t logical_connections ();
50 void physical_connections (size_t count
);
51 size_t physical_connections ();
53 void consecutive_ports (size_t count
);
54 size_t consecutive_ports ();
56 void initial_queue_length (size_t length
);
57 size_t initial_queue_length ();
59 void high_water_mark (size_t size
);
60 size_t high_water_mark ();
62 void low_water_mark (size_t size
);
63 size_t low_water_mark ();
65 void msg_size (size_t size
);
68 void iterations (size_t n
);
71 void n_lwps (size_t n
);
74 void t_flags (long flag
);
86 int do_print_summary ();
90 void print_results ();
92 ACE_Atomic_Op
<ACE_Thread_Mutex
, size_t> msg_count
; // Keep track of number of messages atomically.
93 int *thr_work_count
; // Count activity per-thread.
94 int thr_wc_size
; // Max number of threads.
97 ACE_Profile_Timer _itimer
; // Keep track of time.
98 ACE_TCHAR
*_service_entry
; // Name of the shared object file and shared object.
99 ACE_TCHAR
*_mapped_file
; // Name of the mapped file.
100 ACE_TCHAR
*_pipe_addr
; // Name of the STREAM pipe.
101 size_t _sleep_time
; // Time to sleep.
102 size_t _n_lwps
; // Number of LWPs.
103 size_t _thr_count
; // Number of threads to spawn.
104 long _t_flags
; // Flags to thr_create().
105 size_t _high_water_mark
; // ACE_Queue high water mark.
106 size_t _low_water_mark
; // ACE_Queue low water mark.
107 size_t _msg_size
; // Size of a message.
108 size_t _initial_queue_length
; // Initial number of items in the queue.
109 size_t _logical_connections
; // Number of logical connections.
110 size_t _physical_connections
; // Number of physical connections.
111 size_t _iterations
; // Number of iterations to run the test program.
112 int _generate
; // Generate the data.
113 int _udp
; // Use UDP format.
114 int _debugging
; // Extra debugging info.
115 int _verbosity
; // Extra verbose messages.
116 int _ack
; // Do an acknowledgement.
117 int _checksum
; // Is checksumming enabled?.
118 int _xdr
; // Is xdr conversion enabled?.
119 int _free_memory
; // Are we freeing up memory?.
120 int _zero_copy
; // Implement a zero-copy driver?.
121 int _print_summary
; // Print a summary of the results only.
122 size_t _consecutive_ports
; // Number of consecutive messages from same port.
123 int _eager_exit
; // Exit eagerly, without cleaning up.
126 // Make this available to any code that wants to see it!
127 extern ACE_Svc_Export Performance_Test_Options performance_test_options
;
129 #include "Performance_Test_Options.inl"
130 #endif /* ACE_HAS_THREADS */
131 #endif /* _PERFORMANCE_TEST_OPTIONS_H */