WebSphere Message Broker, Versão 8.0.0.5 Sistemas operacionais: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

Consulte as informações sobre a versão mais recente do produto em IBM Integration Bus, Versão 9.0

Trabalhando com Estatísticas de Recursos em um Aplicativo CMP

Inicie, pare e revise o status da coleta de estatísticas do recurso em seus aplicativos CMP.

Antes de começar:
É possível criar aplicativos CMP para examinar e controlar a coleta de estatísticas do recurso.
Verificando que tipos de recursos podem retornar estatísticas
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and writes out available
// resource types on the broker that have the 
// ability to emit resource-level statistics. 
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	String[] resourceNames = b.getResourceTypeNames();
	for (String thisResource : resourceNames) {
		System.out.println(thisResource);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
Verificando os nomes de recursos associados com um tipo de recurso específico
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and writes out resource property
// names reported for a specific resource type.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	String[] resourcePropertyNames = 
				b.getResourceTypeStatisticsPropertyNames("JVM");
	for (String thisResourceProperty : resourcePropertyNames) {
		System.out.println(thisResourceProperty);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
Iniciando a Coleta de Estatísticas
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and gets a reference to the execution
// group called 'default'. It then enables resource 
// statistics for all the execution group's resource types.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
	if (eg != null) {
		eg.setResourceStatisticsEnabled(null, true);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
Parando a Coleta de Estatísticas
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and gets a reference to the execution
// group called 'default'. It then disables resource 
// statistics for all the execution group's resource types.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
	if (eg != null) {
		eg.setResourceStatisticsEnabled(null, false);
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
Visualizando o Status de Coleta de Estatísticas
///////////////////////////////////////////////////////	
// Sample CMP API code that connects to a local broker
// called 'testbrk' and gets a reference to the execution
// group called 'default'. It then writes out if resource 
// statistics is enabled.
BrokerProxy b = null;
try {
    b = BrokerProxy.getLocalInstance("testbrk");
	ExecutionGroupProxy eg = b.getExecutionGroupByName("default");
	if (eg != null) {
		System.out.println(eg.getResourceStatisticsEnabled(null));
	}
} catch (ConfigManagerProxyLoggedException e) {
	e.printStackTrace();
} catch (ConfigManagerProxyPropertyNotInitializedException e) {
	e.printStackTrace();
}
Avisos | Marcas Registradas | Downloads | Biblioteca | Suporte | Feedback

Copyright IBM Corporation 1999, 2014Copyright IBM Corporation 1999, 2014.

        
        Última atualização:
        
        Última atualização: 2015-02-28 18:31:16


Tópico de TarefaTópico de Tarefa | Versão 8.0.0.5 | be43390_