1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
4 <title>Notification Service Monitor
</title>
9 The notification service monitor adds monitoring capabilities to the TAO
10 Notification Service so that potential problems can be detected in time to
14 The monitoring and control capability is enabled and configured
15 via a service configuration directive. The impact on normal operation of
16 the Notification Service should be minimized whether or not Monitoring
17 and Control is configured.
19 <h2>Using the Notification Service Monitor
</h2>
20 <h3>Configuration
</h3>
22 The monitor is enabled via the Service Configurator. These instructions
23 assume that ACE and TAO are built as dynamic libraries. If you are using
24 static libraries, read these instructions first, then refer to the
25 <a href=
"#static">special procedures for static libraries
</a> section below.
28 Service Configurator commands will enable the monitor:
</p>
30 dynamic TAO_MonitorAndControl Service_Object * TAO_CosNotification_MC:_make_TAO_MonitorAndControl ()
""
31 dynamic TAO_MC_Notify_Service Service_Object * TAO_CosNotification_MC_Ext:_make_TAO_MC_Notify_Service ()
""
34 When the notification service is initialized, the monitor will start up in
35 it's own thread (using it's own ORB) and work in conjunction with the
36 notification service to provide statistics through an IDL interface.
39 The TAO_MonitorAndControl object accepts the following options:
</p>
40 <table border=
1 summary=
"TAO_MonitorAndControl configuration options">
41 <tr><th>Option
</th><th>Description
</th></tr>
44 <td>Instructs the monitor not to register itself with the Name Service.
45 Otherwise, it will be registered as TAO_MonitorAndControl.
49 <td>-ORBArg
<parameter
></td>
50 <td>Passes
<parameter
> to the monitor's ORB upon initialization.
51 There is no limit to the number of times this argument can be
56 <td>-o
<file
></td>
57 <td>Write the IOR of the monitor out to
<file
>.
</td>
60 <h3>Obtaining a reference to the Monitor
</h3>
62 The object reference to the Notification Service Monitor can be obtained
63 one of following ways (depending upon the options passed upon configuration
66 <li>CORBA::Object_var obj = orb-
>string_to_object (
"corbaloc:iiop:<host>:<port>/TAO_MonitorAndControl");
</li>
67 <li>CORBA::Object_var obj = orb-
>string_to_object (
"corbaname:iiop:<nshost>:<nsport>#TAO_MonitorAndControl");
</li>
68 <li>CORBA::Object_var obj = orb-
>string_to_object (
"file://<path to IOR file>");
</li>
70 <h3>Retrieving statistics from the Monitor
</h3>
72 The IDL interface provides a set of methods to obtain statistic names as
73 well as to obtain the statistics themselves.
76 Numeric data is stored in a structure with the following definition:
81 /// The number of samples currently taken into account
84 /// The average of the accumulated samples.
87 /// The sum of the squares of the samples.
88 double sum_of_squares;
90 /// The minimum sample value recorded
93 /// The maximum sample value recorded
96 /// The last sample value recored
101 <p>Text lists are stored in a sequence of strings known as NameList.
</p>
102 <p>These types may be returned as part of a Union depending on the
103 method. The Data union has the following definition:
</p>
105 enum DataType { DATA_NUMERIC, DATA_TEXT };
106 union Data switch (DataType) {
107 case DATA_NUMERIC: Numeric num;
108 case DATA_TEXT: NameList list;
111 <p>The
<b>get_statistic_names()
</b> method returns a
<b>NameList
</b> which
112 contains the names that are currently known by the statistic monitor.
113 This list will change over time.
</p>
114 <p>The
<b>get_statistic(in string name)
</b> returns a
<b>Data
</b> union which
115 contains either a
<b>Numeric
</b> object or a
<b>NameList
</b>, depending upon
116 the type of statistic associated with the provided name. If the name does
117 not correspond to a known statistic, the
<b>InvalidName
</b> exception will be
120 <p> The
<b>get_statistics(in NameList names)
</b> returns a
121 <b>DataList
</b>, which is a sequence of
<b>Data
</b>. The order of the
122 <b>DataList
</b> is the same order as provided within the
<b>NameList
</b>.
123 If any one name provided within the list does not correspond to a known
124 statistic, the
<b>InvalidName
</b> exception will be thrown.
126 <p>The
<b>clear_statistics(in NameList names)
</b> method clears all
127 accumulated statistic data for the provided names. If any one name
128 provided within the list does not correspond to a known statistic, the
129 <b>InvalidName
</b> exception will be thrown.
131 <p>The
<b>get_and_clear_statistics(in NameList names)
</b> method is a
132 combination of
<b>get_statistics()
</b> and
<b>clear_statistics()
</b>.
134 <h3>Affecting the Notification Service with the Monitor
</h3>
135 <p>The
<b>shutdown_event_channel(in string name)
</b>. If the name does
136 not correspond to an event channel, the
<b>InvalidName
</b> exception will be
140 <h3><a name=
"static">Special Procedures for Static Libraries
</a></h3>
141 If ACE and TAO are built as static libraries, follow the instructions above
142 with these modifications:
144 <li>On the mwc.pl command used to generate the build files, add the
145 -features -features
"notify_monitor_control=1" option. For example
146 to build for VC9, the mwc command would look like:
148 mwc.pl -type vc9 -static -features
"notify_monitor_control=1" TAO_ACE.mwc
151 <li>Replace the
"dynamic" service configuration commands with a
"static"
152 commands.
<i>Note that these commands have different syntaxes.
</i>
154 the service configuration commands for a dynamic build are (Lines wrapped
155 for illustrative purposes. In the service conf file the following should
156 appear on two lines):
158 dynamic TAO_MonitorAndControl Service_Object *
159 TAO_CosNotification_MC:_make_TAO_MonitorAndControl ()
161 -ORBArg \"-ORBInitRef -ORBArg NameService=corbaloc:iiop:localhost:
10637/NameService\
""
163 dynamic TAO_MC_Notify_Service Service_Object *
164 TAO_CosNotification_MC_Ext:_make_TAO_MC_Notify_Service ()
165 "-DispatchingThreads 1"
167 </pre></li></ul> you should replace them with
169 static TAO_MonitorAndControl
172 -ORBArg NameService=corbaloc:iiop:localhost:10637/NameService"
174 static TAO_MC_Notify_Service
"-DispatchingThreads 1"
176 Please note that the parser for the static service configuration directives
177 does not honor escaped quotes, so the -ORBArg option must appear separately for
178 each argument to the Notification Service MC's ORB.