3 //=============================================================================
7 * @author Ossama Othman <ossama@dre.vanderbilt.edu>
9 //=============================================================================
12 #ifndef TAO_RPS_MONITOR_H
13 #define TAO_RPS_MONITOR_H
15 #include /**/ "ace/pre.h"
17 #include "orbsvcs/CosLoadBalancingS.h"
19 # if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # endif /* ACE_LACKS_PRAGMA_ONCE */
24 class ServerRequestInterceptor
;
29 * @brief LoadMonitor implementation that calculates the number of
30 * request arriving per second.
33 : public virtual POA_CosLoadBalancing::LoadMonitor
37 RPS_Monitor (ServerRequestInterceptor
* interceptor
);
40 * @name CosLoadBalancing::LoadMonitor Methods
42 * Methods required by the CosLoadBalancing::LoadMonitor interface.
45 /// Return the location at which the LoadMonitor resides.
47 * The returned "Location" is a sequence of length 1.
49 virtual CosLoadBalancing::Location
* the_location ();
51 /// Return the average CPU load at the location which this
52 /// LoadMonitor resides.
54 * @return A "Load" sequence of length 1 that contains a LoadId
55 * equal to CosLoadBalancing::LoadAverage, and the average CPU
58 virtual CosLoadBalancing::LoadList
* loads ();
65 * Protected destructor to enforce proper memory management through
71 /// The name of the location at which this LoadMonitor resides.
72 CosLoadBalancing::Location location_
;
74 ServerRequestInterceptor
* interceptor_
;
76 ACE_Time_Value last_time_
;
78 TAO_SYNCH_MUTEX lock_
;
81 #include /**/ "ace/post.h"
83 #endif /* TAO_RPS_MONITOR_H */