use of com.integrien.alive.common.adapter3.MetricData in project Server_Management_Plugin_vRealize by Huawei.
the class DiskBean method convert2Resource.
@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_DISK, adapterKind);
// 设定唯一的标识,保证同名的资源可以正常显示
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
resourceKey.addIdentifier(dnIdentifier);
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 写入resource属性
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_LOCATION), timestamp, this.location));
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(this.healthState)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MOID), timestamp, this.moId));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PRESENTSTATE), timestamp, ConvertUtils.convertPresentState(this.presentState)));
// 关联key和属性值
metricsByResource.put(resourceKey, metricDataList);
return resourceKey;
}
use of com.integrien.alive.common.adapter3.MetricData in project Server_Management_Plugin_vRealize by Huawei.
the class MemoryBean method convert2Resource.
@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_MEMORY, adapterKind);
// 设定唯一的标识,保证同名的资源可以正常显示
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
resourceKey.addIdentifier(dnIdentifier);
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 写入resource属性
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_CAPACITY), timestamp, this.capacity));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MANUFACTURE), timestamp, this.manufacture));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_FREQUENCY), timestamp, this.frequency));
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(this.healthState)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MOID), timestamp, this.moId));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PRESENTSTATE), timestamp, ConvertUtils.convertPresentState(this.presentState)));
// 关联key和属性值
metricsByResource.put(resourceKey, metricDataList);
return resourceKey;
}
use of com.integrien.alive.common.adapter3.MetricData in project Server_Management_Plugin_vRealize by Huawei.
the class FanBean method convert2Resource.
@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_FAN, adapterKind);
// 设定唯一的标识,保证同名的资源可以正常显示
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
resourceKey.addIdentifier(dnIdentifier);
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 写入resource属性
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(this.healthState)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_ROTATE), timestamp, this.rotate));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_ROTATEPERCENT), timestamp, ConvertUtils.convertRotatePercent(this.controlModel, this.rotatePercent)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_CONTROLMODEL), timestamp, ConvertUtils.convertControlModel(this.controlModel)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MOID), timestamp, this.moId));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PRESENTSTATE), timestamp, ConvertUtils.convertPresentState(this.presentState)));
// 关联key和属性值
metricsByResource.put(resourceKey, metricDataList);
return resourceKey;
}
use of com.integrien.alive.common.adapter3.MetricData in project Server_Management_Plugin_vRealize by Huawei.
the class ServerDeviceDetailBean method convert2Resource.
@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
String resourceName = this.name;
if (resourceName == null || resourceName.isEmpty()) {
resourceName = this.ipAddress;
}
ResourceKey resourceKey = new ResourceKey(resourceName, Constant.KIND_SERVER_DEVICE, adapterKind);
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
resourceKey.addIdentifier(dnIdentifier);
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 写入资源属性
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_DN), timestamp, this.dn));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_IP_ADDRESS), timestamp, this.ipAddress));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_TYPE), timestamp, this.type));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_STATUS), timestamp, ConvertUtils.convertHealthState(this.status)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_DESC), timestamp, this.desc));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PRODUCT_SN), timestamp, this.productSn));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MANUFACTURE), timestamp, this.manufacturer));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_VERSION), timestamp, this.version));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_LOCATION), timestamp, this.location));
// 非机框服务器不需要写入以下属性
if (this.memoryCapacity != null) {
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MEMORY_CAPACITY), timestamp, this.memoryCapacity));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MODEL), timestamp, this.mode));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_BMC_MAC_ADDR), timestamp, this.bmcMacAddr));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_CPU_NUMS), timestamp, this.cpuNums));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_CPU_CORES), timestamp, this.cpuCores));
}
metricsByResource.put(resourceKey, metricDataList);
return resourceKey;
}
use of com.integrien.alive.common.adapter3.MetricData in project Server_Management_Plugin_vRealize by Huawei.
the class MezzBean method convert2Resource.
@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_MEZZ, adapterKind);
// 设定唯一的标识,保证同名的资源可以正常显示
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
resourceKey.addIdentifier(dnIdentifier);
long timestamp = System.currentTimeMillis();
List<MetricData> metricData = new ArrayList<>();
// 写入resource属性
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_NAME), timestamp, this.name));
metricData.add(new MetricData(new MetricKey(false).add(Constant.ATTR_MEZZ_HEALTH_STATUS), timestamp, ConvertUtils.convertHealthState(this.getMezzHealthStatus())));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_PRESENTSTATE), timestamp, ConvertUtils.convertPresentState(this.presentState)));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_INFO), timestamp, this.mezzInfo));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_LOCATION), timestamp, this.mezzLocation));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_ETH_MAC), timestamp, this.mezzETHMac));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_IB_MAC), timestamp, this.mezzIBMac));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_FCWWPN), timestamp, this.mezzFCWWPN));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MOID), timestamp, this.moId));
metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_UUID), timestamp, this.uuid));
// 关联key和属性值
metricsByResource.put(resourceKey, metricData);
return resourceKey;
}
Aggregations