本文整理汇总了Java中com.vmware.vim25.PerfCounterInfo类的典型用法代码示例。如果您正苦于以下问题:Java PerfCounterInfo类的具体用法?Java PerfCounterInfo怎么用?Java PerfCounterInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PerfCounterInfo类属于com.vmware.vim25包,在下文中一共展示了PerfCounterInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: findMetricId
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
/**
* Makes a PerfMetricId by looking up the counterId for the given group/name/rollupType/... params.
*
* https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.PerformanceManager.MetricId.html
*
* See <a href="https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/cpu_counters.html">cpu counters</a>
* See <a href="https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/memory_counters.html>memory counters</a>
* See <a href="https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/network_counters.html">network counters</a>
*
* @param group
* @param name
* @param rollupType
* @return null if a PerfCoutner cannot be found for the given params
*/
private PerfMetricId findMetricId(String group, String name, PerfStatsType type,
PerformanceManagerUnit unit, PerfSummaryType rollupType) {
PerfMetricId res = new PerfMetricId();
PerfCounterInfo counter = this.perfCounterLookup
.getCounter(name, group, type, rollupType, unit);
if (counter == null) {
String msg = String
.format("Cannot find metric for %s/%s/%s/%s/%s", group, name, type,
rollupType.value(),
unit.value());
logger.warning(msg);
throw new IllegalArgumentException(msg);
}
res.setCounterId(counter.getKey());
res.setInstance("");
return res;
}
开发者ID:vmware,项目名称:photon-model,代码行数:33,代码来源:StatsClient.java
示例2: lookup
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public PerfCounterInfo[] lookup(String groupName, String counterName, PerfSummaryType rollupType) {
assert (groupName != null);
assert (counterName != null);
Map<String, List<PerfCounterInfo>> groupMap = _mapCounterInfos.get(groupName);
if (groupMap == null)
return null;
List<PerfCounterInfo> counterInfoList = groupMap.get(counterName);
if (counterInfoList == null)
return null;
if (rollupType == null) {
return counterInfoList.toArray(new PerfCounterInfo[0]);
}
for (PerfCounterInfo info : counterInfoList) {
if (info.getRollupType() == rollupType)
return new PerfCounterInfo[] {info};
}
return null;
}
开发者ID:apache,项目名称:cloudstack,代码行数:24,代码来源:PerfCounterInfoMapper.java
示例3: createStat
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
@Override
public ServiceStat createStat(PerfCounterInfo pc, List<PerfSampleInfo> infos,
List<Long> values) {
if (infos == null || infos.isEmpty()) {
return null;
}
ServiceStat res = new ServiceStat();
res.name = this.name;
res.unit = this.unit;
PerfSampleInfo info = null;
double converted = 0;
int intervalLengthMinutes = 5;
res.timeSeriesStats = new TimeSeriesStats(24 * 60 / intervalLengthMinutes,
intervalLengthMinutes * 60 * 1000,
EnumSet.allOf(AggregationType.class));
for (int i = 0; i < infos.size(); i++) {
info = infos.get(i);
Long value = values.get(i);
converted = convertValue(value);
res.timeSeriesStats.add(getSampleTimestampMicros(info), converted, converted);
}
res.sourceTimeMicrosUtc = res.lastUpdateMicrosUtc = getSampleTimestampMicros(info);
res.latestValue = converted;
return res;
}
开发者ID:vmware,项目名称:photon-model,代码行数:34,代码来源:DailyAggregator.java
示例4: querySingleEntity
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
/**
* See <a href="https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.PerformanceManager.html#queryStats">queryStats method</a>
* @param ctx
* @return
* @throws RuntimeFaultFaultMsg
*/
private List<ServiceStat> querySingleEntity(StatCollectionContext ctx)
throws RuntimeFaultFaultMsg {
List<PerfEntityMetricBase> metrics = getVimPort().queryPerf(PERF_MGR_MOREF,
Collections.singletonList(ctx.getSpec()));
List<ServiceStat> res = new ArrayList<>();
if (metrics.isEmpty()) {
// nothing fetched
return Collections.emptyList();
}
// the metrics for the single entity
PerfEntityMetric m = (PerfEntityMetric) metrics.get(0);
for (PerfMetricSeries pms : m.getValue()) {
PerfMetricId metricId = pms.getId();
PerfMetricIntSeries series = (PerfMetricIntSeries) pms;
SamplesAggregator factory = ctx.getFactory(metricId.getCounterId());
PerfCounterInfo counter = this.perfCounterLookup
.getCounterByKey(metricId.getCounterId());
ServiceStat stat = factory.createStat(counter, m.getSampleInfo(), series.getValue());
if (stat != null) {
res.add(stat);
}
}
return res;
}
开发者ID:vmware,项目名称:photon-model,代码行数:38,代码来源:StatsClient.java
示例5: getCounter
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public PerfCounterInfo getCounter(String name, String groupName, PerfStatsType type,
PerfSummaryType rollupType,
PerformanceManagerUnit unit) {
for (PerfCounterInfo pci : this.counters) {
if (pci.getNameInfo().getKey().equals(name) &&
pci.getGroupInfo().getKey().equals(groupName) &&
pci.getRollupType().equals(rollupType) &&
pci.getStatsType().equals(type) &&
pci.getUnitInfo().getKey().equals(unit.value())) {
return pci;
}
}
return null;
}
开发者ID:vmware,项目名称:photon-model,代码行数:16,代码来源:PerfCounterLookup.java
示例6: getCounterByKey
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public PerfCounterInfo getCounterByKey(int key) {
for (PerfCounterInfo pci : this.counters) {
if (pci.getKey() == key) {
return pci;
}
}
return null;
}
开发者ID:vmware,项目名称:photon-model,代码行数:10,代码来源:PerfCounterLookup.java
示例7: main
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public static void main(String[] args) throws Exception
{
if(args.length != 3)
{
System.out.println("Usage: java PrintPerfMgr "
+ "<url> <username> <password>");
return;
}
ServiceInstance si = new ServiceInstance(
new URL(args[0]), args[1], args[2], true);
PerformanceManager perfMgr = si.getPerformanceManager();
System.out.println("***Print All Descriptions:");
PerformanceDescription pd = perfMgr.getDescription();
printPerfDescription(pd);
System.out.println("\n***Print All Historical Intervals:");
PerfInterval[] pis = perfMgr.getHistoricalInterval();
printPerfIntervals(pis);
System.out.println("\n***Print All Perf Counters:");
PerfCounterInfo[] pcis = perfMgr.getPerfCounter();
printPerfCounters(pcis);
si.getServerConnection().logout();
}
开发者ID:Juniper,项目名称:vijava,代码行数:29,代码来源:PrintPerfMgr.java
示例8: printPerfCounters
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
static void printPerfCounters(PerfCounterInfo[] pcis)
{
for(int i=0; pcis!=null && i<pcis.length; i++)
{
System.out.println("\nKey:" + pcis[i].getKey());
String perfCounter = pcis[i].getGroupInfo().getKey() + "."
+ pcis[i].getNameInfo().getKey() + "."
+ pcis[i].getRollupType();
System.out.println("PerfCounter:" + perfCounter);
System.out.println("Level:" + pcis[i].getLevel());
System.out.println("StatsType:" + pcis[i].getStatsType());
System.out.println("UnitInfo:"
+ pcis[i].getUnitInfo().getKey());
}
}
开发者ID:Juniper,项目名称:vijava,代码行数:16,代码来源:PrintPerfMgr.java
示例9: getPerfCounterInfoMap
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
/**
* This method retrieves the performance counters available.
*
* @return a map of performance counters
*/
public Map<Integer, PerfCounterInfo> getPerfCounterInfoMap() {
if (m_perfCounterInfoMap == null) {
m_perfCounterInfoMap = new HashMap<Integer, PerfCounterInfo>();
PerfCounterInfo[] perfCounterInfos = getPerformanceManager().getPerfCounter();
for (PerfCounterInfo perfCounterInfo : perfCounterInfos) {
m_perfCounterInfoMap.put(perfCounterInfo.getKey(), perfCounterInfo);
}
}
return m_perfCounterInfoMap;
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:18,代码来源:VmwareViJavaAccess.java
示例10: PerfCounterInfoMapper
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public PerfCounterInfoMapper(PerfCounterInfo[] counterInfos) {
if (counterInfos != null) {
for (PerfCounterInfo counterInfo : counterInfos) {
List<PerfCounterInfo> counterInfoList = getSafeCounterInfoList(counterInfo.getGroupInfo().getKey(), counterInfo.getNameInfo().getKey());
counterInfoList.add(counterInfo);
}
}
}
开发者ID:apache,项目名称:cloudstack,代码行数:9,代码来源:PerfCounterInfoMapper.java
示例11: lookupOne
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public PerfCounterInfo lookupOne(String groupName, String counterName, PerfSummaryType rollupType) {
PerfCounterInfo[] infos = lookup(groupName, counterName, rollupType);
if (infos != null && infos.length > 0)
return infos[0];
return null;
}
开发者ID:apache,项目名称:cloudstack,代码行数:8,代码来源:PerfCounterInfoMapper.java
示例12: getSafeGroupMap
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
private Map<String, List<PerfCounterInfo>> getSafeGroupMap(String groupName) {
Map<String, List<PerfCounterInfo>> groupMap = _mapCounterInfos.get(groupName);
if (groupMap == null) {
groupMap = new HashMap<String, List<PerfCounterInfo>>();
_mapCounterInfos.put(groupName, groupMap);
}
return groupMap;
}
开发者ID:apache,项目名称:cloudstack,代码行数:9,代码来源:PerfCounterInfoMapper.java
示例13: getSafeCounterInfoList
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
private List<PerfCounterInfo> getSafeCounterInfoList(String groupName, String counterName) {
Map<String, List<PerfCounterInfo>> groupMap = getSafeGroupMap(groupName);
assert (groupMap != null);
List<PerfCounterInfo> counterInfoList = groupMap.get(counterName);
if (counterInfoList == null) {
counterInfoList = new ArrayList<PerfCounterInfo>();
groupMap.put(counterName, counterInfoList);
}
return counterInfoList;
}
开发者ID:apache,项目名称:cloudstack,代码行数:12,代码来源:PerfCounterInfoMapper.java
示例14: queryPerfCounter
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public List<PerfCounterInfo> queryPerfCounter(int[] counterId) throws Exception {
List<Integer> counterArr = new ArrayList<Integer>();
if (counterId != null) {
for (int i = 0; i < counterId.length; i++) {
counterArr.add(counterId[i]);
}
}
return _context.getService().queryPerfCounter(_mor, counterArr);
}
开发者ID:apache,项目名称:cloudstack,代码行数:10,代码来源:PerfManagerMO.java
示例15: PerfCounterLookup
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public PerfCounterLookup(List<PerfCounterInfo> counters) {
this.counters = counters;
}
开发者ID:vmware,项目名称:photon-model,代码行数:4,代码来源:PerfCounterLookup.java
示例16: queryPerformanceValues
import com.vmware.vim25.PerfCounterInfo; //导入依赖的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;
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:50,代码来源:VmwareViJavaAccess.java
示例17: queryPerfCounterByLevel
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public List<PerfCounterInfo> queryPerfCounterByLevel(int level) throws Exception {
return _context.getService().queryPerfCounterByLevel(_mor, level);
}
开发者ID:apache,项目名称:cloudstack,代码行数:4,代码来源:PerfManagerMO.java
示例18: getCounterInfo
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
public List<PerfCounterInfo> getCounterInfo() throws Exception {
return _context.getVimClient().getDynamicProperty(_mor, "perfCounter");
}
开发者ID:apache,项目名称:cloudstack,代码行数:4,代码来源:PerfManagerMO.java
示例19: getHumanReadableName
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
/**
* Generates a human-readable name for a performance counter.
*
* @param perfCounterInfo the perfomance counter info object
* @return a string-representation of the performance counter's name
*/
private String getHumanReadableName(PerfCounterInfo perfCounterInfo) {
return perfCounterInfo.getGroupInfo().getKey() + "." + perfCounterInfo.getNameInfo().getKey() + "." + perfCounterInfo.getRollupType().toString();
}
开发者ID:qoswork,项目名称:opennmszh,代码行数:10,代码来源:VmwareViJavaAccess.java
示例20: createStat
import com.vmware.vim25.PerfCounterInfo; //导入依赖的package包/类
ServiceStat createStat(PerfCounterInfo counter, List<PerfSampleInfo> infos, List<Long> data);
开发者ID:vmware,项目名称:photon-model,代码行数:2,代码来源:SamplesAggregator.java
注:本文中的com.vmware.vim25.PerfCounterInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论