Metrics info about each other services in IceBox

in Help Center
Hi, all! I use IceGrid
and my Client retrieve info about all metrics from all active servers:
When IceBox is active, I can retrieve info about IceBox, but how retrieve info metrics about each active services in IceBox?
Now for example I get info:
Simpe-server1: all info about metric (Connection,Threads, etc.)
...
Services(<--my IceBox):all info about metric (Connection,Threads, etc.)
?? How get info metrics from each active services(metric info about child of ICeBox)?
Im try found IceBox Api, but is nothing. Maximum IceBox Admin give me opportunity such as stop, start, using observer, if you have name of services(how its get, i am not know) Each service have info about metrics and ICeGrid Graphic Tool know how retrieve its.
please Help me!
Config xml for IceGrid:
<icegrid>
<application name="Simple">
<server-template id="Simple Server">
<parameter name="index"/>
<server id="Simple Server-${index}" exe="./server.exe" activation="on-demand">
<adapter name="Observer" endpoints="tcp -h localhost" replica- group="ReplicatedObserverAdapter"/>
<property name="Identity" value="observer"/>
<property name="IceMX.Metrics.Debug.GroupBy" value="operation"/>
<property name="IceMX.Metrics.Debug.Disabled" value="0"/>
<property name="IceMX.Metrics.Debug1.GroupBy" value="id"/>
<property name="IceMX.Metrics.Debug1.Disabled" value="0"/>
<property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/>
<property name="IceMX.Metrics.ByParent.Disabled" value="0"/>
</server>
</server-template>
<service-template id="Services">
<parameter name ="name"/>
<service name="${name}" entry="services.dll:ServiceImageI">
<property name="Hello.Identity" value="hello"/>
<adapter name="Hello-${name}" endpoints="default" id="Hello-${name}" replica-group="ImageGroup" server-lifetime="false"/>
</service>
</service-template>
<replica-group id="ImageGroup">
<load-balancing type="round-robin" n-replicas="1"/>
<object identity="hello" type="::ManagerImage::ManagerImagee"/>
</replica-group>
<replica-group id="ReplicatedObserverAdapter">
<load-balancing type="round-robin"/>
<object identity="observer" type="::IceGrid::NodeObserver"/>
</replica-group>
<node name="node1">
<server-instance template="Simple Server" index="1"/>
<server-instance template="Simple Server" index="2"/>
<server-instance template="Simple Server" index="3"/>
<icebox id="Services" activation="on-demand" exe="iceboxnet.exe">
<service name="ServiceImage" entry="services.dll:ServiceImageI">
<adapter name="adapter" endpoints="tcp"/>
<property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/>
<property name="IceMX.Metrics.ByParent.Disabled" value="0"/>
</service>
<property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/>
<property name="IceMX.Metrics.ByParent.Disabled" value="0"/>
</icebox>
</node>
<node name="node2">
<server-instance template="Simple Server" index="4"/>
<server-instance template="Simple Server" index="5"/>
<server-instance template="Simple Server" index="6"/>
</node>
</application>
</icegrid>
and my Client retrieve info about all metrics from all active servers:
When IceBox is active, I can retrieve info about IceBox, but how retrieve info metrics about each active services in IceBox?
Now for example I get info:
Simpe-server1: all info about metric (Connection,Threads, etc.)
...
Services(<--my IceBox):all info about metric (Connection,Threads, etc.)
?? How get info metrics from each active services(metric info about child of ICeBox)?
Im try found IceBox Api, but is nothing. Maximum IceBox Admin give me opportunity such as stop, start, using observer, if you have name of services(how its get, i am not know) Each service have info about metrics and ICeGrid Graphic Tool know how retrieve its.
please Help me!
Config xml for IceGrid:
<icegrid>
<application name="Simple">
<server-template id="Simple Server">
<parameter name="index"/>
<server id="Simple Server-${index}" exe="./server.exe" activation="on-demand">
<adapter name="Observer" endpoints="tcp -h localhost" replica- group="ReplicatedObserverAdapter"/>
<property name="Identity" value="observer"/>
<property name="IceMX.Metrics.Debug.GroupBy" value="operation"/>
<property name="IceMX.Metrics.Debug.Disabled" value="0"/>
<property name="IceMX.Metrics.Debug1.GroupBy" value="id"/>
<property name="IceMX.Metrics.Debug1.Disabled" value="0"/>
<property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/>
<property name="IceMX.Metrics.ByParent.Disabled" value="0"/>
</server>
</server-template>
<service-template id="Services">
<parameter name ="name"/>
<service name="${name}" entry="services.dll:ServiceImageI">
<property name="Hello.Identity" value="hello"/>
<adapter name="Hello-${name}" endpoints="default" id="Hello-${name}" replica-group="ImageGroup" server-lifetime="false"/>
</service>
</service-template>
<replica-group id="ImageGroup">
<load-balancing type="round-robin" n-replicas="1"/>
<object identity="hello" type="::ManagerImage::ManagerImagee"/>
</replica-group>
<replica-group id="ReplicatedObserverAdapter">
<load-balancing type="round-robin"/>
<object identity="observer" type="::IceGrid::NodeObserver"/>
</replica-group>
<node name="node1">
<server-instance template="Simple Server" index="1"/>
<server-instance template="Simple Server" index="2"/>
<server-instance template="Simple Server" index="3"/>
<icebox id="Services" activation="on-demand" exe="iceboxnet.exe">
<service name="ServiceImage" entry="services.dll:ServiceImageI">
<adapter name="adapter" endpoints="tcp"/>
<property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/>
<property name="IceMX.Metrics.ByParent.Disabled" value="0"/>
</service>
<property name="IceMX.Metrics.ByParent.GroupBy" value="parent"/>
<property name="IceMX.Metrics.ByParent.Disabled" value="0"/>
</icebox>
</node>
<node name="node2">
<server-instance template="Simple Server" index="4"/>
<server-instance template="Simple Server" index="5"/>
<server-instance template="Simple Server" index="6"/>
</node>
</application>
</icegrid>
0
Comments
You need to configure metrics for the service by adding IceMX properties under the XML <service> definition, for example:
See the C++ demo/IceGrid/icebox demo from your Ice demo distribution for an example.
Cheers,
Benoit.
At present there's no Slice API to retrieve the list of active services in an IceBox server. You could maintain this list yourself however by subscribing an observer with the IceBox::ServiceManager::addObserver method. See IceBox Administration - Ice 3.5 - ZeroC in the Ice manual for more information on the service manager interface.
Note that with IceGrid, you can retrieve the IceBox server Ice.Admin object using the IceGrid::Admin interface and the getServerAdmin method. For example:
See IceGrid and the Administrative Facility - Ice 3.5 - ZeroC for more information on this.
Cheers,
Benoit.
I try looking for how retrieve info metrics of services (programmatically) in Ice-3.5.1.zip\Ice-3.5.1\java\src\IceGridGUI\...
Code:
Ice.PropertiesAdminPrx propAdmin =
Ice.PropertiesAdminPrxHelper.uncheckedCast(serverAdmin.ice_facet("IceBox.Service." + _id +
".Properties"));
How in IceGridGui retrieve _id ? (id service) I not think this is with help of icebox Observer.:(
The code that you are showing is to obtain the properties admin facet for a specific service so you indeed need to know the service name to create the proxy for this facet. You don't need this to register an observer with the service manager object of an IceBox server. To register an observer, you can follow the example at this link: IceGrid and the Administrative Facility - Ice 3.5 - ZeroC in the Ice manual.
Note that if you just want to obtain the list of services deployed with the IceBox server (not the list of active vs. inactive services), an easier option is to consult the deployment information for your IceBox server:
You'll find more details on IceGrid descriptor types in the IceGrid Slice API - Ice 3.5 - ZeroC.
Cheers,
Benoit.
Pinging the metrics admin Ice object won't indicate whether or not the service is started or stopped, this Ice object is "hosted" by the IceBox server so it will always be accessible as long as the IceBox server is active.
You need to register an IceBox service observer in order to monitor which services are active and which services are inactive.
For example:
You can also follow the directions from the Ice manual for information on how to do this: IceGrid and the Administrative Facility - Ice 3.5 - ZeroC. The code sample in the manual is a bit more complex because of the configuration of the PublishedEndpoints property for the object adapter, this isn't strictly necessary if you only have one callback object to register.
Cheers,
Benoit.