我正在重构一个用PowerBuilder和Java编写的现有应用程序,它运行在Sybase EA Server(Jaguar)上.我正在构建一个小框架来包装EA Server中可用的Jaguar API函数.其中一个类是使用Monitoring该类从EA Server获取运行时统计信息.
MonitoringEA Service API中的一个类提供了Jaguar运行时监控统计信息(实际的类是C++; EA Server在Java中为这些提供了包装,因此可以通过CORBA访问它们),而不需要太多细节.
以下是我班级的简化版本.(我创建了一个超类,我继承了它来获取组件,连接缓存,HTTP等的统计信息).
public class JagMonCompStats {
...
public void dumpStats(String type, String entity) {
private String type = "Component";
private String entity = "web_business_rules";
private String[] header = {"Active", "Pooled", "invoke"};
// This has a lot more keys, simplified for this discussion
private static short[] compKeys = {
(short) (MONITOR_COMPONENT_ACTIVE.value),
(short) (MONITOR_COMPONENT_POOLED.value),
(short) (MONITOR_COMPONENT_INVOKE.value)
};
private double[] data = null;
...
/* Call to Jaguar API */ …Run Code Online (Sandbox Code Playgroud)