144 lines
5.2 KiB
Groovy
144 lines
5.2 KiB
Groovy
package biz.nellemann.hmci
|
|
|
|
import groovy.util.logging.Slf4j
|
|
|
|
@Slf4j
|
|
class LogicalPartition extends MetaSystem {
|
|
|
|
public String id
|
|
public String name
|
|
public String type
|
|
ManagedSystem system
|
|
|
|
LogicalPartition(String id, String name, String type, ManagedSystem system) {
|
|
this.id = id
|
|
this.name = name
|
|
this.type = type
|
|
this.system = system
|
|
}
|
|
|
|
String toString() {
|
|
return "[${id}] ${name} (${type})"
|
|
}
|
|
|
|
|
|
List<Map> getMemoryMetrics() {
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
system: system.name,
|
|
partition: name,
|
|
]
|
|
map.put("tags", tagsMap)
|
|
log.debug(tagsMap.toString())
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
|
logicalMem: metrics.systemUtil.utilSamples.first().lparsUtil.first().memory.logicalMem.first(),
|
|
backedPhysicalMem: metrics.systemUtil.utilSamples.first().lparsUtil.first().memory.backedPhysicalMem.first(),
|
|
]
|
|
map.put("fields", fieldsMap)
|
|
log.debug(fieldsMap.toString())
|
|
|
|
list.add(map)
|
|
return list
|
|
}
|
|
|
|
|
|
List<Map> getProcessorMetrics() {
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
system: system.name,
|
|
partition: name,
|
|
]
|
|
map.put("tags", tagsMap)
|
|
log.debug(tagsMap.toString())
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
|
utilizedProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.utilizedProcUnits.first(),
|
|
//maxVirtualProcessors: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.maxVirtualProcessors.first(),
|
|
//currentVirtualProcessors: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.currentVirtualProcessors.first(),
|
|
//donatedProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.donatedProcUnits.first(),
|
|
//entitledProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.entitledProcUnits.first(),
|
|
//idleProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.idleProcUnits.first(),
|
|
//maxProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.maxProcUnits.first(),
|
|
utilizedCappedProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.utilizedCappedProcUnits.first(),
|
|
utilizedUncappedProcUnits: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.utilizedUncappedProcUnits.first(),
|
|
timePerInstructionExecution: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.timeSpentWaitingForDispatch.first(),
|
|
timeSpentWaitingForDispatch: metrics.systemUtil.utilSamples.first().lparsUtil.first().processor.timePerInstructionExecution.first(),
|
|
]
|
|
map.put("fields", fieldsMap)
|
|
log.debug(fieldsMap.toString())
|
|
|
|
list.add(map)
|
|
return list
|
|
}
|
|
|
|
|
|
List<Map> getVirtualEthernetAdapterMetrics() {
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
metrics.systemUtil.utilSamples.first().lparsUtil.first().network?.virtualEthernetAdapters?.each {
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
system: system.name,
|
|
partition: name,
|
|
sea: it.sharedEthernetAdapterId as String,
|
|
viosId: it.viosId as String,
|
|
vlanId: it.vlanId as String,
|
|
vswitchId: it.vswitchId as String,
|
|
]
|
|
map.put("tags", tagsMap)
|
|
log.debug(tagsMap.toString())
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
|
receivedPhysicalBytes: it.receivedPhysicalBytes.first(),
|
|
sentPhysicalBytes: it.sentPhysicalBytes.first(),
|
|
receivedBytes: it.receivedBytes.first(),
|
|
sentBytes: it.sentBytes.first(),
|
|
]
|
|
map.put("fields", fieldsMap)
|
|
log.debug(fieldsMap.toString())
|
|
|
|
list.add(map)
|
|
}
|
|
|
|
return list
|
|
}
|
|
|
|
|
|
//PartitionVirtualFiberChannelAdapters
|
|
List<Map> getVirtualFiberChannelAdaptersMetrics() {
|
|
|
|
List<Map> list = new ArrayList<>()
|
|
Map<String, Map> map = new HashMap<String, Map>()
|
|
metrics.systemUtil.utilSamples.first().lparsUtil.first().storage?.virtualFiberChannelAdapters?.each {
|
|
|
|
HashMap<String, String> tagsMap = [
|
|
system: system.name,
|
|
partition: name,
|
|
viosId: it.viosId as String,
|
|
wwpn: it.wwpn,
|
|
]
|
|
map.put("tags", tagsMap)
|
|
log.debug(tagsMap.toString())
|
|
|
|
HashMap<String, BigDecimal> fieldsMap = [
|
|
transmittedBytes: it.transmittedBytes.first(),
|
|
writeBytes: it.writeBytes.first(),
|
|
]
|
|
map.put("fields", fieldsMap)
|
|
log.debug(fieldsMap.toString())
|
|
|
|
list.add(map)
|
|
}
|
|
|
|
return list
|
|
}
|
|
}
|