Hyperic Java API
我编写了一些 Java 代码,通过它们从 Hyperic Server 获取某些操作的指标。我无法获取这些指标的值。
对于 eq 我有指标 CPU 空闲,但是当我使用 List时dp= m1.getDataPoint()
其中,m1
是指标 CPU Idle 的指标数据对象。在输出中,列表 dp
的大小为 0
。
除了“可用性”之外的所有指标我都遇到这个问题。我应该怎么办?
我还检查了图形界面中的时间间隔;它显示相应的值。
代码在
// m_rrc is resource ( Process Server) on agent
for (int z = 0; z < m_rrrc.size(); z++) {
System.out.println(m_rrrc.get(z).getName())
MetricsResponse m_mr= m_a.getMetrics(m_rrrc.get(z));
// m_m is metric like CPU idle CPU utilization, System CPU
List<Metric> m_m = m_mr.getMetric();
for (int a = 0; a < m_m.size(); a++) {
MetricDataResponse m_mdr = m_mdapi.getData(m_m.get(a), 1309147200,1309147800);
MetricData m_md = m_mdr.getMetricData();
System.out.println(m_md.getMetricName());
List<DataPoint> m_dp = m_md.getDataPoint();
System.out.println(m_dp.size());
for (int b = 0; b < m_dp.size(); b++) {
System.out.println("abc");
System.out.println(m_dp.get(b).getValue());
System.out.println("i am Prannoy Mittal");
}
}
}
这里,所有指标的输出中数据点列表的大小为零
I have written some Java code through which I fetch metrics from Hyperic Server for some operations. I have not been able to fetch the value of these metrics.
for eq I have metric CPU Idle but when i use List<Data Point> dp= m1.getDataPoint()
where m1
is the metric data object of metric CPU Idle. In the output the size of list dp
is 0
.
I'm having this problem with all metrics except "availability". What should I do?
I have also checked the time interval in the graphical interface; it is showing the corresponding values.
the code is
// m_rrc is resource ( Process Server) on agent
for (int z = 0; z < m_rrrc.size(); z++) {
System.out.println(m_rrrc.get(z).getName())
MetricsResponse m_mr= m_a.getMetrics(m_rrrc.get(z));
// m_m is metric like CPU idle CPU utilization, System CPU
List<Metric> m_m = m_mr.getMetric();
for (int a = 0; a < m_m.size(); a++) {
MetricDataResponse m_mdr = m_mdapi.getData(m_m.get(a), 1309147200,1309147800);
MetricData m_md = m_mdr.getMetricData();
System.out.println(m_md.getMetricName());
List<DataPoint> m_dp = m_md.getDataPoint();
System.out.println(m_dp.size());
for (int b = 0; b < m_dp.size(); b++) {
System.out.println("abc");
System.out.println(m_dp.get(b).getValue());
System.out.println("i am Prannoy Mittal");
}
}
}
here size of data point list in output for all metrics is zero
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下是 Hyperic 的示例源代码(http://svn.hyperic.org/projects/hqapi/trunk/src/org/hyperic/hq/hqapi1/test/MetricData_test.java),如果你可以正确放置'assertEquals ' 在你的代码中我相信你会看到问题出在哪里。祝你好运
Here is sample source code from Hyperic (http://svn.hyperic.org/projects/hqapi/trunk/src/org/hyperic/hq/hqapi1/test/MetricData_test.java), if you can put right 'assertEquals' in your code I am sure you will see where the problem is. Good luck