Cleanup code.
This commit is contained in:
parent
ec14809d2d
commit
ebf84c8350
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
.gradle
|
.gradle
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
|
|
|
@ -193,7 +193,7 @@ class HmcClient {
|
||||||
Map<String, LogicalPartition> getLogicalPartitionsForManagedSystem(ManagedSystem system) throws Exception {
|
Map<String, LogicalPartition> getLogicalPartitionsForManagedSystem(ManagedSystem system) throws Exception {
|
||||||
URL url = new URL(String.format("%s/rest/api/uom/ManagedSystem/%s/LogicalPartition", baseUrl, system.id));
|
URL url = new URL(String.format("%s/rest/api/uom/ManagedSystem/%s/LogicalPartition", baseUrl, system.id));
|
||||||
String responseBody = getResponse(url);
|
String responseBody = getResponse(url);
|
||||||
Map<String, LogicalPartition> partitionMap = new HashMap<String, LogicalPartition>() {};
|
Map<String, LogicalPartition> partitionMap = new HashMap<String, LogicalPartition>();
|
||||||
|
|
||||||
// Do not try to parse empty response
|
// Do not try to parse empty response
|
||||||
if(responseBody == null || responseBody.isEmpty() || responseBody.length() <= 1) {
|
if(responseBody == null || responseBody.isEmpty() || responseBody.length() <= 1) {
|
||||||
|
|
|
@ -49,24 +49,14 @@ class LogicalPartition extends MetaSystem {
|
||||||
List<Measurement> getAffinityScore() {
|
List<Measurement> getAffinityScore() {
|
||||||
|
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
|
||||||
|
|
||||||
Map<String, String> tagsMap = new HashMap<String, String>() {
|
Map<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", system.name);
|
||||||
put("system", system.name);
|
tagsMap.put("partition", name);
|
||||||
put("partition", name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
|
||||||
log.debug("getAffinityScore() - tags: " + tagsMap.toString());
|
log.debug("getAffinityScore() - tags: " + tagsMap.toString());
|
||||||
Map<String, Number> fieldsMap = new HashMap<String, Number>() {
|
|
||||||
{
|
|
||||||
put("affinityScore", metrics.systemUtil.sample.lparsUtil.affinityScore);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("fields", fieldsMap)
|
Map<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
|
fieldsMap.put("affinityScore", metrics.systemUtil.sample.lparsUtil.affinityScore);
|
||||||
log.debug("getAffinityScore() - fields: " + fieldsMap.toString());
|
log.debug("getAffinityScore() - fields: " + fieldsMap.toString());
|
||||||
|
|
||||||
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
||||||
|
@ -78,27 +68,15 @@ class LogicalPartition extends MetaSystem {
|
||||||
List<Measurement> getMemoryMetrics() {
|
List<Measurement> getMemoryMetrics() {
|
||||||
|
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
|
||||||
|
|
||||||
Map<String, String> tagsMap = new HashMap<String, String>() {
|
Map<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", system.name);
|
||||||
put("system", system.name);
|
tagsMap.put("partition", name);
|
||||||
put("partition", name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
|
||||||
log.debug("getMemoryMetrics() - tags: " + tagsMap.toString());
|
log.debug("getMemoryMetrics() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
Map<String, Number> fieldsMap = new HashMap<String, Number>() {
|
Map<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("logicalMem", metrics.systemUtil.sample.lparsUtil.memory.logicalMem);
|
||||||
put("logicalMem", metrics.systemUtil.sample.lparsUtil.memory.logicalMem);
|
fieldsMap.put("backedPhysicalMem", metrics.systemUtil.sample.lparsUtil.memory.backedPhysicalMem);
|
||||||
put("backedPhysicalMem", metrics.systemUtil.sample.lparsUtil.memory.backedPhysicalMem);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//map.put("fields", fieldsMap)
|
|
||||||
log.debug("getMemoryMetrics() - fields: " + fieldsMap.toString());
|
log.debug("getMemoryMetrics() - fields: " + fieldsMap.toString());
|
||||||
|
|
||||||
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
||||||
|
@ -111,35 +89,24 @@ class LogicalPartition extends MetaSystem {
|
||||||
List<Measurement> getProcessorMetrics() {
|
List<Measurement> getProcessorMetrics() {
|
||||||
|
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", system.name);
|
||||||
put("system", system.name);
|
tagsMap.put("partition", name);
|
||||||
put("partition", name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
|
||||||
log.debug("getProcessorMetrics() - tags: " + tagsMap.toString());
|
log.debug("getProcessorMetrics() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("utilizedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedProcUnits);
|
||||||
put("utilizedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedProcUnits);
|
fieldsMap.put("maxVirtualProcessors", metrics.systemUtil.sample.lparsUtil.processor.maxVirtualProcessors);
|
||||||
put("maxVirtualProcessors", metrics.systemUtil.sample.lparsUtil.processor.maxVirtualProcessors);
|
fieldsMap.put("currentVirtualProcessors", metrics.systemUtil.sample.lparsUtil.processor.currentVirtualProcessors);
|
||||||
put("currentVirtualProcessors", metrics.systemUtil.sample.lparsUtil.processor.currentVirtualProcessors);
|
//fieldsMap.donatedProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.donatedProcUnits.first(),
|
||||||
//donatedProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.donatedProcUnits.first(),
|
fieldsMap.put("entitledProcUnits", metrics.systemUtil.sample.lparsUtil.processor.entitledProcUnits);
|
||||||
put("entitledProcUnits", metrics.systemUtil.sample.lparsUtil.processor.entitledProcUnits);
|
//fieldsMap.idleProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.idleProcUnits.first(),
|
||||||
//idleProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.idleProcUnits.first(),
|
//fieldsMap.maxProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.maxProcUnits.first(),
|
||||||
//maxProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.maxProcUnits.first(),
|
fieldsMap.put("utilizedCappedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedCappedProcUnits);
|
||||||
put("utilizedCappedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedCappedProcUnits);
|
fieldsMap.put("utilizedUncappedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedUncappedProcUnits);
|
||||||
put("utilizedUncappedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedUncappedProcUnits);
|
fieldsMap.put("timePerInstructionExecution", metrics.systemUtil.sample.lparsUtil.processor.timeSpentWaitingForDispatch);
|
||||||
put("timePerInstructionExecution", metrics.systemUtil.sample.lparsUtil.processor.timeSpentWaitingForDispatch);
|
fieldsMap.put("timeSpentWaitingForDispatch", metrics.systemUtil.sample.lparsUtil.processor.timePerInstructionExecution);
|
||||||
put("timeSpentWaitingForDispatch", metrics.systemUtil.sample.lparsUtil.processor.timePerInstructionExecution);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("fields", fieldsMap)
|
|
||||||
log.debug("getProcessorMetrics() - fields: " + fieldsMap.toString());
|
log.debug("getProcessorMetrics() - fields: " + fieldsMap.toString());
|
||||||
|
|
||||||
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
||||||
|
@ -154,26 +121,20 @@ class LogicalPartition extends MetaSystem {
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
metrics.systemUtil.sample.lparsUtil.network.virtualEthernetAdapters.forEach( adapter -> {
|
metrics.systemUtil.sample.lparsUtil.network.virtualEthernetAdapters.forEach( adapter -> {
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", system.name);
|
||||||
put("system", system.name);
|
tagsMap.put("partition", name);
|
||||||
put("partition", name);
|
tagsMap.put("sea", adapter.sharedEthernetAdapterId);
|
||||||
put("sea", adapter.sharedEthernetAdapterId);
|
tagsMap.put("viosId", adapter.viosId.toString());
|
||||||
put("viosId", adapter.viosId.toString());
|
tagsMap.put("vlanId", adapter.vlanId.toString());
|
||||||
put("vlanId", adapter.vlanId.toString());
|
tagsMap.put("vswitchId", adapter.vswitchId.toString());
|
||||||
put("vswitchId", adapter.vswitchId.toString());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
log.debug("getVirtualEthernetAdapterMetrics() - tags: " + tagsMap.toString());
|
log.debug("getVirtualEthernetAdapterMetrics() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("receivedPhysicalBytes", adapter.receivedPhysicalBytes);
|
||||||
put("receivedPhysicalBytes", adapter.receivedPhysicalBytes);
|
fieldsMap.put("sentPhysicalBytes", adapter.sentPhysicalBytes);
|
||||||
put("sentPhysicalBytes", adapter.sentPhysicalBytes);
|
fieldsMap.put("receivedBytes", adapter.receivedBytes);
|
||||||
put("receivedBytes", adapter.receivedBytes);
|
fieldsMap.put("sentBytes", adapter.sentBytes);
|
||||||
put("sentBytes", adapter.sentBytes);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
log.debug("getVirtualEthernetAdapterMetrics() - fields: " + fieldsMap.toString());
|
log.debug("getVirtualEthernetAdapterMetrics() - fields: " + fieldsMap.toString());
|
||||||
|
|
||||||
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
||||||
|
@ -190,29 +151,18 @@ class LogicalPartition extends MetaSystem {
|
||||||
|
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
metrics.systemUtil.sample.lparsUtil.storage.virtualFiberChannelAdapters.forEach( adapter -> {
|
metrics.systemUtil.sample.lparsUtil.storage.virtualFiberChannelAdapters.forEach( adapter -> {
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", system.name);
|
||||||
put("system", system.name);
|
tagsMap.put("partition", name);
|
||||||
put("partition", name);
|
tagsMap.put("viosId", adapter.viosId.toString());
|
||||||
put("viosId", adapter.viosId.toString());
|
tagsMap.put("wwpn", adapter.wwpn);
|
||||||
put("wwpn", adapter.wwpn);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
|
||||||
log.debug("getVirtualFiberChannelAdaptersMetrics() - tags: " + tagsMap.toString());
|
log.debug("getVirtualFiberChannelAdaptersMetrics() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes.get(0));
|
||||||
put("transmittedBytes", adapter.transmittedBytes.get(0));
|
fieldsMap.put("writeBytes", adapter.writeBytes.get(0));
|
||||||
put("writeBytes", adapter.writeBytes.get(0));
|
fieldsMap.put("readBytes", adapter.readBytes.get(0));
|
||||||
put("readBytes", adapter.readBytes.get(0));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("fields", fieldsMap)
|
|
||||||
log.debug("getVirtualFiberChannelAdaptersMetrics() - fields: " + fieldsMap.toString());
|
log.debug("getVirtualFiberChannelAdaptersMetrics() - fields: " + fieldsMap.toString());
|
||||||
|
|
||||||
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
Measurement measurement = new Measurement(tagsMap, fieldsMap);
|
||||||
|
|
|
@ -54,23 +54,17 @@ class ManagedSystem extends MetaSystem {
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
//Map<String, Map> map = new HashMap<String, Map>()
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
//map.put("tags", tagsMap)
|
||||||
log.debug("getMemoryMetrics() - tags: " + tagsMap.toString());
|
log.debug("getMemoryMetrics() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
Map<String, Number> fieldsMap = new HashMap<String, Number>() {
|
Map<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("totalMem", metrics.systemUtil.sample.serverUtil.memory.totalMem);
|
||||||
put("totalMem", metrics.systemUtil.sample.serverUtil.memory.totalMem);
|
fieldsMap.put("availableMem", metrics.systemUtil.sample.serverUtil.memory.availableMem);
|
||||||
put("availableMem", metrics.systemUtil.sample.serverUtil.memory.availableMem);
|
fieldsMap.put("configurableMem", metrics.systemUtil.sample.serverUtil.memory.configurableMem);
|
||||||
put("configurableMem", metrics.systemUtil.sample.serverUtil.memory.configurableMem);
|
fieldsMap.put("assignedMemToLpars", metrics.systemUtil.sample.serverUtil.memory.assignedMemToLpars);
|
||||||
put("assignedMemToLpars", metrics.systemUtil.sample.serverUtil.memory.assignedMemToLpars);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("fields", fieldsMap)
|
//map.put("fields", fieldsMap)
|
||||||
log.debug("getMemoryMetrics() - fields: " + fieldsMap.toString());
|
log.debug("getMemoryMetrics() - fields: " + fieldsMap.toString());
|
||||||
|
@ -87,24 +81,19 @@ class ManagedSystem extends MetaSystem {
|
||||||
List<Measurement> list = new ArrayList<>();
|
List<Measurement> list = new ArrayList<>();
|
||||||
//Map<String, Map> map = new HashMap<>()
|
//Map<String, Map> map = new HashMap<>()
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
//map.put("tags", tagsMap)
|
||||||
//measurement.tags = tagsMap;
|
//measurement.tags = tagsMap;
|
||||||
log.debug("getProcessorMetrics() - tags: " + tagsMap.toString());
|
log.debug("getProcessorMetrics() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("totalProcUnits", metrics.systemUtil.sample.serverUtil.processor.totalProcUnits);
|
||||||
put("totalProcUnits", metrics.systemUtil.sample.serverUtil.processor.totalProcUnits);
|
fieldsMap.put("utilizedProcUnits", metrics.systemUtil.sample.serverUtil.processor.utilizedProcUnits);
|
||||||
put("utilizedProcUnits", metrics.systemUtil.sample.serverUtil.processor.utilizedProcUnits);
|
fieldsMap.put("availableProcUnits", metrics.systemUtil.sample.serverUtil.processor.availableProcUnits);
|
||||||
put("availableProcUnits", metrics.systemUtil.sample.serverUtil.processor.availableProcUnits);
|
fieldsMap.put("configurableProcUnits", metrics.systemUtil.sample.serverUtil.processor.configurableProcUnits);
|
||||||
put("configurableProcUnits", metrics.systemUtil.sample.serverUtil.processor.configurableProcUnits);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//map.put("fields", fieldsMap)
|
//map.put("fields", fieldsMap)
|
||||||
//measurement.fields = fieldsMap;
|
//measurement.fields = fieldsMap;
|
||||||
log.debug("getProcessorMetrics() - fields: " + fieldsMap.toString());
|
log.debug("getProcessorMetrics() - fields: " + fieldsMap.toString());
|
||||||
|
@ -122,22 +111,16 @@ class ManagedSystem extends MetaSystem {
|
||||||
metrics.systemUtil.sample.serverUtil.sharedProcessorPool.forEach(adapter -> {
|
metrics.systemUtil.sample.serverUtil.sharedProcessorPool.forEach(adapter -> {
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
//Map<String, Map> map = new HashMap<String, Map>()
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
tagsMap.put("pool", adapter.name);
|
||||||
put("pool", adapter.name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
//map.put("tags", tagsMap)
|
||||||
log.debug("getSharedProcessorPools() - tags: " + tagsMap.toString());
|
log.debug("getSharedProcessorPools() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("assignedProcUnits", adapter.assignedProcUnits);
|
||||||
put("assignedProcUnits", adapter.assignedProcUnits);
|
fieldsMap.put("availableProcUnits", adapter.availableProcUnits);
|
||||||
put("availableProcUnits", adapter.availableProcUnits);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("fields", fieldsMap)
|
//map.put("fields", fieldsMap)
|
||||||
log.debug("getSharedProcessorPools() - fields: " + fieldsMap.toString());
|
log.debug("getSharedProcessorPools() - fields: " + fieldsMap.toString());
|
||||||
|
@ -159,25 +142,20 @@ class ManagedSystem extends MetaSystem {
|
||||||
//Map<String, Map> map = new HashMap<String, Map>()
|
//Map<String, Map> map = new HashMap<String, Map>()
|
||||||
Measurement measurement = new Measurement();
|
Measurement measurement = new Measurement();
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
tagsMap.put("type", adapter.type);
|
||||||
put("type", adapter.type);
|
tagsMap.put("vios", vios.name);
|
||||||
put("vios", vios.name);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
//map.put("tags", tagsMap)
|
||||||
measurement.tags = tagsMap;
|
measurement.tags = tagsMap;
|
||||||
log.debug("getSystemSharedAdapters() - tags: " + tagsMap.toString());
|
log.debug("getSystemSharedAdapters() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("sentBytes", adapter.sentBytes);
|
||||||
put("sentBytes", adapter.sentBytes);
|
fieldsMap.put("receivedBytes", adapter.receivedBytes);
|
||||||
put("receivedBytes", adapter.receivedBytes);
|
fieldsMap.put("transferredBytes", adapter.transferredBytes);
|
||||||
put("transferredBytes", adapter.transferredBytes);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//map.put("fields", fieldsMap)
|
//map.put("fields", fieldsMap)
|
||||||
measurement.fields = fieldsMap;
|
measurement.fields = fieldsMap;
|
||||||
log.debug("getSystemSharedAdapters() - fields: " + fieldsMap.toString());
|
log.debug("getSystemSharedAdapters() - fields: " + fieldsMap.toString());
|
||||||
|
@ -201,27 +179,22 @@ class ManagedSystem extends MetaSystem {
|
||||||
//HashMap<String, Map> map = new HashMap<>()
|
//HashMap<String, Map> map = new HashMap<>()
|
||||||
Measurement measurement = new Measurement();
|
Measurement measurement = new Measurement();
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("id", adapter.id);
|
||||||
put("id", adapter.id);
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
tagsMap.put("wwpn", adapter.wwpn);
|
||||||
put("wwpn", adapter.wwpn);
|
tagsMap.put("vios", vios.name);
|
||||||
put("vios", vios.name);
|
tagsMap.put("device", adapter.physicalLocation);
|
||||||
put("device", adapter.physicalLocation);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//map.put("tags", tagsMap)
|
//map.put("tags", tagsMap)
|
||||||
measurement.tags = tagsMap;
|
measurement.tags = tagsMap;
|
||||||
log.debug("getSystemFiberChannelAdapters() - tags: " + tagsMap.toString());
|
log.debug("getSystemFiberChannelAdapters() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
||||||
put("writeBytes", adapter.writeBytes);
|
fieldsMap.put("readBytes", adapter.readBytes);
|
||||||
put("readBytes", adapter.readBytes);
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
||||||
put("transmittedBytes", adapter.transmittedBytes);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
//map.put("fields", fieldsMap)
|
//map.put("fields", fieldsMap)
|
||||||
measurement.fields = fieldsMap;
|
measurement.fields = fieldsMap;
|
||||||
log.debug("getSystemFiberChannelAdapters() - fields: " + fieldsMap.toString());
|
log.debug("getSystemFiberChannelAdapters() - fields: " + fieldsMap.toString());
|
||||||
|
@ -245,25 +218,19 @@ class ManagedSystem extends MetaSystem {
|
||||||
|
|
||||||
Measurement measurement = new Measurement();
|
Measurement measurement = new Measurement();
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("id", adapter.id);
|
||||||
put("id", adapter.id);
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
tagsMap.put("vios", vios.name);
|
||||||
put("vios", vios.name);
|
tagsMap.put("device", adapter.physicalLocation);
|
||||||
put("device", adapter.physicalLocation);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
measurement.tags = tagsMap;
|
measurement.tags = tagsMap;
|
||||||
log.debug("getSystemGenericPhysicalAdapters() - tags: " + tagsMap.toString());
|
log.debug("getSystemGenericPhysicalAdapters() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
||||||
put("writeBytes", adapter.writeBytes);
|
fieldsMap.put("readBytes", adapter.readBytes);
|
||||||
put("readBytes", adapter.readBytes);
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
||||||
put("transmittedBytes", adapter.transmittedBytes);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
measurement.fields = fieldsMap;
|
measurement.fields = fieldsMap;
|
||||||
log.debug("getSystemGenericPhysicalAdapters() - fields: " + fieldsMap.toString());
|
log.debug("getSystemGenericPhysicalAdapters() - fields: " + fieldsMap.toString());
|
||||||
|
@ -287,25 +254,19 @@ class ManagedSystem extends MetaSystem {
|
||||||
|
|
||||||
Measurement measurement = new Measurement();
|
Measurement measurement = new Measurement();
|
||||||
|
|
||||||
HashMap<String, String> tagsMap = new HashMap<String, String>() {
|
HashMap<String, String> tagsMap = new HashMap<String, String>();
|
||||||
{
|
tagsMap.put("id", adapter.id);
|
||||||
put("id", adapter.id);
|
tagsMap.put("system", name);
|
||||||
put("system", name);
|
tagsMap.put("vios", vios.name);
|
||||||
put("vios", vios.name);
|
tagsMap.put("device", adapter.physicalLocation);
|
||||||
put("device", adapter.physicalLocation);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
measurement.tags = tagsMap;
|
measurement.tags = tagsMap;
|
||||||
log.debug("getSystemGenericVirtualAdapters() - tags: " + tagsMap.toString());
|
log.debug("getSystemGenericVirtualAdapters() - tags: " + tagsMap.toString());
|
||||||
|
|
||||||
HashMap<String, Number> fieldsMap = new HashMap<String, Number>() {
|
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
|
||||||
{
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
||||||
put("writeBytes", adapter.writeBytes);
|
fieldsMap.put("readBytes", adapter.readBytes);
|
||||||
put("readBytes", adapter.readBytes);
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
||||||
put("transmittedBytes", adapter.transmittedBytes);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
measurement.fields = fieldsMap;
|
measurement.fields = fieldsMap;
|
||||||
log.debug("getSystemGenericVirtualAdapters() - fields: " + fieldsMap.toString());
|
log.debug("getSystemGenericVirtualAdapters() - fields: " + fieldsMap.toString());
|
||||||
|
|
|
@ -95,7 +95,7 @@ abstract class MetaSystem {
|
||||||
|
|
||||||
@FromJson
|
@FromJson
|
||||||
Number fromJson(String string) {
|
Number fromJson(String string) {
|
||||||
return new Double(string);
|
return Double.parseDouble(string);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ToJson
|
@ToJson
|
||||||
|
|
Loading…
Reference in a new issue