本文整理汇总了Java中com.vmware.vim25.PerfQuerySpec.setMaxSample方法的典型用法代码示例。如果您正苦于以下问题:Java PerfQuerySpec.setMaxSample方法的具体用法?Java PerfQuerySpec.setMaxSample怎么用?Java PerfQuerySpec.setMaxSample使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vmware.vim25.PerfQuerySpec
的用法示例。
在下文中一共展示了PerfQuerySpec.setMaxSample方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPerfQuerySpec
import com.vmware.vim25.PerfQuerySpec; //导入方法依赖的package包/类
static PerfQuerySpec createPerfQuerySpec(ManagedEntity me,
PerfMetricId[] metricIds, int maxSample, int interval)
{
PerfQuerySpec qSpec = new PerfQuerySpec();
qSpec.setEntity(me.getMOR());
// set the maximum of metrics to be return
// only appropriate in real-time performance collecting
qSpec.setMaxSample(new Integer(maxSample));
// qSpec.setMetricId(metricIds);
// optionally you can set format as "normal"
qSpec.setFormat("csv");
// set the interval to the refresh rate for the entity
qSpec.setIntervalId(new Integer(interval));
return qSpec;
}
示例2: createPerfQuerySpec
import com.vmware.vim25.PerfQuerySpec; //导入方法依赖的package包/类
private static PerfQuerySpec createPerfQuerySpec(ManagedEntity me, PerfMetricId[] metricIds, int maxSample, int interval) {
PerfQuerySpec qSpec = new PerfQuerySpec();
qSpec.setEntity(me.getMOR());
// set the maximum of metrics to be return
// only appropriate in real-time performance collecting
qSpec.setMaxSample(new Integer(maxSample));
// qSpec.setMetricId(metricIds);
// optionally you can set format as "normal"
qSpec.setFormat("normal");
// set the interval to the refresh rate for the entity
qSpec.setIntervalId(new Integer(interval));
return qSpec;
}
示例3: queryPerformanceValues
import com.vmware.vim25.PerfQuerySpec; //导入方法依赖的package包/类
/**
* This method queries performance values for a given managed entity.
*
* @param managedEntity the managed entity to query
* @return the perfomance values
* @throws RemoteException
*/
public VmwarePerformanceValues queryPerformanceValues(ManagedEntity managedEntity) throws RemoteException {
VmwarePerformanceValues vmwarePerformanceValues = new VmwarePerformanceValues();
int refreshRate = getPerformanceManager().queryPerfProviderSummary(managedEntity).getRefreshRate();
PerfQuerySpec perfQuerySpec = new PerfQuerySpec();
perfQuerySpec.setEntity(managedEntity.getMOR());
perfQuerySpec.setMaxSample(Integer.valueOf(1));
perfQuerySpec.setIntervalId(refreshRate);
PerfEntityMetricBase[] perfEntityMetricBases = getPerformanceManager().queryPerf(new PerfQuerySpec[]{perfQuerySpec});
if (perfEntityMetricBases != null) {
for (int i = 0; i < perfEntityMetricBases.length; i++) {
PerfMetricSeries[] perfMetricSeries = ((PerfEntityMetric) perfEntityMetricBases[i]).getValue();
for (int j = 0; perfMetricSeries != null && j < perfMetricSeries.length; j++) {
if (perfMetricSeries[j] instanceof PerfMetricIntSeries) {
long[] longs = ((PerfMetricIntSeries) perfMetricSeries[j]).getValue();
if (longs.length == 1) {
PerfCounterInfo perfCounterInfo = getPerfCounterInfoMap().get(perfMetricSeries[j].getId().getCounterId());
String instance = perfMetricSeries[j].getId().getInstance();
String name = getHumanReadableName(perfCounterInfo);
if (instance != null && !"".equals(instance)) {
vmwarePerformanceValues.addValue(name, instance, longs[0]);
} else {
vmwarePerformanceValues.addValue(name, longs[0]);
}
}
}
}
}
}
return vmwarePerformanceValues;
}