summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/FaultTolerance/FLARe/Utilization_Monitor.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/examples/FaultTolerance/FLARe/Utilization_Monitor.h')
-rw-r--r--TAO/orbsvcs/examples/FaultTolerance/FLARe/Utilization_Monitor.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/TAO/orbsvcs/examples/FaultTolerance/FLARe/Utilization_Monitor.h b/TAO/orbsvcs/examples/FaultTolerance/FLARe/Utilization_Monitor.h
new file mode 100644
index 00000000000..2784d88b4cb
--- /dev/null
+++ b/TAO/orbsvcs/examples/FaultTolerance/FLARe/Utilization_Monitor.h
@@ -0,0 +1,37 @@
+
+#ifndef UTILIZATION_MONITOR_H
+#define UTILIZATION_MONITOR_H
+
+#include "Timer.h"
+#include "CPULoadCalculator.h"
+#include <fstream>
+
+class RM_Proxy;
+
+
+class Utilization_Monitor : protected Timer,
+ public CPULoadCalculator
+{
+public:
+
+ using Timer::start;
+ using Timer::stop;
+ using Timer::hertz;
+
+ explicit Utilization_Monitor (CPULoadCalculator *load_calc);
+ virtual ~Utilization_Monitor ();
+
+ /// Helper function to be called back after a timeout
+ virtual int pulse (void);
+ virtual double percent_load (void);
+ void setRM_Proxy (RM_Proxy *rm_proxy);
+
+private:
+ std::auto_ptr <CPULoadCalculator> load_calc_;
+ RM_Proxy *rm_proxy_;
+ double load_;
+ std::ofstream outfile_;
+};
+
+
+#endif /* UTILIZATION_MONITOR_H */