3 // ============================================================================
6 // This is a helper class for the throughput tests of the Event
8 // Used for the collocated test.
10 // ============================================================================
12 #ifndef ECT_THROUGHPUT_H
13 #define ECT_THROUGHPUT_H
15 #include "ECT_Driver.h"
16 #include "ECT_Consumer.h"
17 #include "ECT_Supplier.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 class ECT_Throughput
: public ECT_Driver
26 ECT_Throughput (void);
28 virtual ~ECT_Throughput (void);
32 // Maximum number of consumers.
34 // Maximum number of suppliers.
37 int run (int argc
, ACE_TCHAR
* argv
[]);
40 virtual void shutdown_consumer (void* consumer_cookie
);
41 // Callback method for consumers, each consumer will call this
42 // method once it receives all the shutdown events from the
46 int parse_args (int argc
, ACE_TCHAR
* argv
[]);
47 // parse the command line args
49 void connect_consumers (RtecScheduler::Scheduler_ptr scheduler
,
50 RtecEventChannelAdmin::EventChannel_ptr local_ec
);
51 void disconnect_consumers (void);
52 // Connect and disconnect the consumers.
54 void connect_suppliers (RtecScheduler::Scheduler_ptr scheduler
,
55 RtecEventChannelAdmin::EventChannel_ptr local_ec
);
56 void disconnect_suppliers (void);
57 // Connect the suppliers.
59 void activate_suppliers (void);
60 // Activate the suppliers, i.e. they start generating events.
62 void dump_results (void);
63 // Dump the results for each supplier.
66 Test_Consumer
* consumers_
[ECT_Throughput::MAX_CONSUMERS
];
67 // The consumer array.
70 // The number of consumers.
72 Test_Supplier
* suppliers_
[ECT_Throughput::MAX_SUPPLIERS
];
73 // The suppliers array.
76 // The number of suppliers.
79 // How many bursts we will send from each supplier.
82 // The number of events
85 // The size of the payload on each event.
88 // The time between each event burst, in microseconds.
90 int consumer_type_start_
;
91 int consumer_type_count_
;
92 int consumer_type_shift_
;
93 // The consumers subscribe to different sets of events, as follows:
94 // Consumer0: [start , start + count)
95 // Consumer1: [start + 1*shift, start + 1*shift + count)
96 // Consumer2: [start + 2*shift, start + 2*shift + count)
99 int supplier_type_start_
;
100 int supplier_type_count_
;
101 int supplier_type_shift_
;
102 // The suppliers generate different sets of events, as follows:
103 // Supplier0: [start , start + count)
104 // Supplier1: [start + 1*shift, start + 1*shift + count)
105 // Supplier2: [start + 2*shift, start + 2*shift + count)
108 const ACE_TCHAR
* pid_file_name_
;
109 // The name of a file where the process stores its pid
112 // A reference to the ORB, to shut it down properly.
114 TAO_SYNCH_MUTEX lock_
;
116 // How many consumers are still receiving events.
118 int ec_concurrency_hwm_
;
119 // Set the HWM for the concurrency in the EC.
121 int thr_create_flags_
;
122 // The thread creation flags
125 #endif /* ECT_TRHOUGHPUT_H */