More work on PCM data

This commit is contained in:
Mark Nellemann 2020-08-08 13:24:48 +02:00
parent d0332ce006
commit 504058ae7a
18 changed files with 93 additions and 766 deletions

View file

@ -23,9 +23,7 @@ import java.security.cert.X509Certificate;
@Slf4j @Slf4j
class Hmc { class Hmc {
private static final MediaType MEDIA_TYPE_PLAIN = MediaType.parse("text/plain; charset=utf-8"); private final MediaType MEDIA_TYPE_IBM_XML_LOGIN = MediaType.parse("application/vnd.ibm.powervm.web+xml; type=LogonRequest");
private static final MediaType MEDIA_TYPE_XML = MediaType.parse("application/xml; charset=utf-8");
private static final MediaType MEDIA_TYPE_IBM_XML_LOGIN = MediaType.parse("application/vnd.ibm.powervm.web+xml; type=LogonRequest");
private final String baseUrl private final String baseUrl
private final String username private final String username
@ -152,8 +150,6 @@ class Hmc {
} }
} }
} }
} }

View file

@ -1,6 +1,5 @@
package biz.nellemann.hmci package biz.nellemann.hmci
import biz.nellemann.hmci.pojo.SystemUtil import biz.nellemann.hmci.pojo.SystemUtil
import groovy.json.JsonSlurper import groovy.json.JsonSlurper
import groovy.util.logging.Slf4j import groovy.util.logging.Slf4j
@ -23,6 +22,7 @@ class LogicalPartition {
} }
void processMetrics(String json) { void processMetrics(String json) {
//metrics = new JsonSlurper().parseText(json) as SystemUtil
def pcmMap = new JsonSlurper().parseText(json) def pcmMap = new JsonSlurper().parseText(json)
metrics = new SystemUtil(pcmMap as Map) metrics = new SystemUtil(pcmMap as Map)
} }

View file

@ -3,6 +3,7 @@ package biz.nellemann.hmci
import biz.nellemann.hmci.pojo.PcmData import biz.nellemann.hmci.pojo.PcmData
import groovy.json.JsonSlurper import groovy.json.JsonSlurper
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j import groovy.util.logging.Slf4j
@Slf4j @Slf4j
@ -17,7 +18,6 @@ class ManagedSystem {
protected PcmData metrics protected PcmData metrics
ManagedSystem(String id) { ManagedSystem(String id) {
this.id = id this.id = id
} }
@ -27,6 +27,7 @@ class ManagedSystem {
} }
void processMetrics(String json) { void processMetrics(String json) {
//metrics = new JsonSlurper().parseText(json) as PcmData
def pcmMap = new JsonSlurper().parseText(json) def pcmMap = new JsonSlurper().parseText(json)
metrics = new PcmData(pcmMap as Map) metrics = new PcmData(pcmMap as Map)
} }

View file

@ -0,0 +1,18 @@
package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class GenericAdapter {
String id
String type
String physicalLocation
List<BigDecimal> receivedPackets
List<BigDecimal> sentPackets
List<BigDecimal> droppedPackets
List<BigDecimal> sentBytes
List<BigDecimal> receivedBytes
List<BigDecimal> transferredBytes
}

View file

@ -1,5 +1,8 @@
package biz.nellemann.hmci.pojo package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class LparProcessor { class LparProcessor {
Integer poolId Integer poolId

View file

@ -4,5 +4,7 @@ import groovy.transform.ToString
@ToString @ToString
class Network { class Network {
List<GenericAdapter> genericAdapters
List<SharedAdapter> sharedAdapters
List<VirtualEthernetAdapter> virtualEthernetAdapters List<VirtualEthernetAdapter> virtualEthernetAdapters
} }

View file

@ -4,5 +4,7 @@ import groovy.transform.ToString
@ToString @ToString
class PcmData { class PcmData {
SystemUtil systemUtil SystemUtil systemUtil
} }

View file

@ -0,0 +1,14 @@
package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class PhysicalProcessorPool {
List<BigDecimal> assignedProcUnits
List<BigDecimal> utilizedProcUnits
List<BigDecimal> availableProcUnits
List<BigDecimal> configuredProcUnits
List<BigDecimal> borrowedProcUnits
}

View file

@ -4,8 +4,10 @@ import groovy.transform.ToString
@ToString @ToString
class ServerMemory { class ServerMemory {
List<BigDecimal> totalMem List<BigDecimal> totalMem
List<BigDecimal> availableMem List<BigDecimal> availableMem
List<BigDecimal> configurableMem List<BigDecimal> configurableMem
List<BigDecimal> assignedMemToLpars List<BigDecimal> assignedMemToLpars
} }

View file

@ -4,6 +4,7 @@ import groovy.transform.ToString
@ToString @ToString
class ServerProcessor { class ServerProcessor {
List<BigDecimal> totalProcUnits List<BigDecimal> totalProcUnits
List<BigDecimal> utilizedProcUnits List<BigDecimal> utilizedProcUnits
List<BigDecimal> availableProcUnits List<BigDecimal> availableProcUnits

View file

@ -4,46 +4,10 @@ import groovy.transform.ToString
@ToString @ToString
class ServerUtil { class ServerUtil {
ServerProcessor processor ServerProcessor processor
ServerMemory memory ServerMemory memory
PhysicalProcessorPool physicalProcessorPool
SharedProcessorPool sharedProcessorPool
/*
"physicalProcessorPool": {
"assignedProcUnits": [
23.879
],
"utilizedProcUnits": [
0.007
],
"availableProcUnits": [
23.872
],
"configuredProcUnits": [
0.000
],
"borrowedProcUnits": [
16.000
]
},
"sharedProcessorPool": [
{
"id": 0,
"name": "DefaultPool",
"assignedProcUnits": [
23.879
],
"utilizedProcUnits": [
0.005
],
"availableProcUnits": [
23.874
],
"configuredProcUnits": [
6.000
],
"borrowedProcUnits": [
16.000
]
}
]*/
} }

View file

@ -0,0 +1,19 @@
package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class SharedAdapter {
String id
String type
String physicalLocation
List<BigDecimal> receivedPackets
List<BigDecimal> sentPackets
List<BigDecimal> droppedPackets
List<BigDecimal> sentBytes
List<BigDecimal> receivedBytes
List<BigDecimal> transferredBytes
List<String> bridgedAdapters
}

View file

@ -0,0 +1,16 @@
package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class SharedProcessorPool {
String id
String name
List<BigDecimal> assignedProcUnits
List<BigDecimal> utilizedProcUnits
List<BigDecimal> availableProcUnits
List<BigDecimal> configuredProcUnits
List<BigDecimal> borrowedProcUnits
}

View file

@ -1,8 +1,14 @@
package biz.nellemann.hmci.pojo package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class Storage { class Storage {
List<String> clientLpars
List<GenericPhysicalAdapters> genericPhysicalAdapters List<GenericPhysicalAdapters> genericPhysicalAdapters
List<GenericVirtualAdapter> genericVirtualAdapters List<GenericVirtualAdapter> genericVirtualAdapters
List<VirtualFiberChannelAdapter> virtualFiberChannelAdapters List<VirtualFiberChannelAdapter> virtualFiberChannelAdapters
List<FiberChannelAdapter> fiberChannelAdapters List<FiberChannelAdapter> fiberChannelAdapters
} }

View file

@ -8,18 +8,4 @@ class SystemUtil {
UtilInfo utilInfo UtilInfo utilInfo
List<UtilSample> utilSamples List<UtilSample> utilSamples
/*
Integer id
String uuid
String name
String state
String type
String osType
Integer integeraffinityScore
Memory memory
Processor processor
Network network
Storage storage*/
} }

View file

@ -15,7 +15,6 @@ class UtilInfo {
String mtms String mtms
String name String name
String uuid String uuid
List<String> metricArrayOrder List<String> metricArrayOrder
} }

View file

@ -1,5 +1,8 @@
package biz.nellemann.hmci.pojo package biz.nellemann.hmci.pojo
import groovy.transform.ToString
@ToString
class UtilSample { class UtilSample {
String sampleType String sampleType

View file

@ -21,709 +21,4 @@ class ViosUtil {
List<BigDecimal> utilizedMem List<BigDecimal> utilizedMem
} }
/*
"viosUtil": [
{
"id": 1,
"uuid": "2F30379A-860B-4661-A24E-CD8E449C81AC",
"name": "VIOS1",
"state": "Running",
"affinityScore": 100,
"memory": {
"assignedMem": [
8192.000
],
"utilizedMem": [
2061.000
]
},
"processor": {
"weight": 0,
"mode": "share_idle_procs_active",
"maxVirtualProcessors": [
2.000
],
"currentVirtualProcessors": [
0.000
],
"maxProcUnits": [
2.000
],
"entitledProcUnits": [
1.000
],
"utilizedProcUnits": [
0.006
],
"utilizedCappedProcUnits": [
0.079
],
"utilizedUncappedProcUnits": [
0.000
],
"idleProcUnits": [
0.073
],
"donatedProcUnits": [
0.921
],
"timeSpentWaitingForDispatch": [
0.000
],
"timePerInstructionExecution": [
51.000
]
},
"network": {
"clientLpars": [
"62F4D488-C838-41E2-B83B-E68E004E3B63"
],
"genericAdapters": [
{
"id": "ent2",
"type": "physical",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C10-T3",
"receivedPackets": [
29.733
],
"sentPackets": [
25.900
],
"droppedPackets": [
0.000
],
"sentBytes": [
7508.933
],
"receivedBytes": [
5676.000
],
"transferredBytes": [
13184.933
]
},
{
"id": "ent6",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V1-C3-T1",
"receivedPackets": [
12.967
],
"sentPackets": [
9.700
],
"droppedPackets": [
0.000
],
"sentBytes": [
3348.667
],
"receivedBytes": [
2401.733
],
"transferredBytes": [
5750.400
]
},
{
"id": "ent4",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V1-C2-T1",
"receivedPackets": [
26.900
],
"sentPackets": [
33.800
],
"droppedPackets": [
0.000
],
"sentBytes": [
8853.333
],
"receivedBytes": [
8214.933
],
"transferredBytes": [
17068.266
]
}
],
"sharedAdapters": [
{
"id": "ent5",
"type": "sea",
"physicalLocation": "U8247.22L.213C1BA-V1-C2-T1",
"receivedPackets": [
56.633
],
"sentPackets": [
59.700
],
"droppedPackets": [
0.000
],
"sentBytes": [
16362.267
],
"receivedBytes": [
13890.933
],
"transferredBytes": [
30253.200
],
"bridgedAdapters": [
"ent2",
"ent4",
"ent4"
]
}
],
"virtualEthernetAdapters": [
{
"physicalLocation": "U8247.22L.213C1BA-V1-C2",
"vlanId": 1,
"vswitchId": 0,
"isPortVlanId": true,
"receivedPackets": [
10.467
],
"sentPackets": [
14.667
],
"droppedPackets": [
0.000
],
"sentBytes": [
1931.333
],
"receivedBytes": [
3875.433
],
"receivedPhysicalPackets": [
0.000
],
"sentPhysicalPackets": [
0.000
],
"droppedPhysicalPackets": [
0.000
],
"sentPhysicalBytes": [
0.000
],
"receivedPhysicalBytes": [
0.000
],
"transferredBytes": [
5806.766
],
"transferredPhysicalBytes": [
0.000
]
},
{
"physicalLocation": "U8247.22L.213C1BA-V1-C3",
"vlanId": 1,
"vswitchId": 0,
"isPortVlanId": true,
"receivedPackets": [
6.100
],
"sentPackets": [
1.700
],
"droppedPackets": [
0.000
],
"sentBytes": [
1420.533
],
"receivedBytes": [
575.100
],
"receivedPhysicalPackets": [
6.100
],
"sentPhysicalPackets": [
1.700
],
"droppedPhysicalPackets": [
0.000
],
"sentPhysicalBytes": [
1420.533
],
"receivedPhysicalBytes": [
575.100
],
"transferredBytes": [
1995.633
],
"transferredPhysicalBytes": [
1995.633
]
}
]
},
"storage": {
"clientLpars": [
"62F4D488-C838-41E2-B83B-E68E004E3B63"
],
"genericPhysicalAdapters": [
{
"id": "sissas0",
"type": "sas",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C14-T1",
"numOfReads": [
0.000
],
"numOfWrites": [
4.533
],
"readBytes": [
0.000
],
"writeBytes": [
2321.067
],
"transmittedBytes": [
2321.067
]
}
],
"genericVirtualAdapters": [
{
"id": "vhost1",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V1-C6",
"numOfReads": [
0.000
],
"numOfWrites": [
0.000
],
"readBytes": [
0.000
],
"writeBytes": [
0.000
],
"transmittedBytes": [
0.000
]
},
{
"id": "vhost0",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V1-C5",
"numOfReads": [
0.500
],
"numOfWrites": [
0.500
],
"readBytes": [
256.000
],
"writeBytes": [
256.000
],
"transmittedBytes": [
512.000
]
},
{
"id": "vhost2",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V1-C7",
"numOfReads": [
0.000
],
"numOfWrites": [
0.000
],
"readBytes": [
0.000
],
"writeBytes": [
0.000
],
"transmittedBytes": [
0.000
]
}
],
"fiberChannelAdapters": [
{
"id": "fcs0",
"wwpn": "10000090faba5108",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C12-T1",
"numOfPorts": 3,
"numOfReads": [
0.000
],
"numOfWrites": [
0.467
],
"readBytes": [
0.000
],
"writeBytes": [
30583.467
],
"runningSpeed": [
8.000
],
"transmittedBytes": [
30583.467
]
},
{
"id": "fcs1",
"wwpn": "10000090faba5109",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C12-T2",
"numOfPorts": 0,
"numOfReads": [
0.000
],
"numOfWrites": [
0.000
],
"readBytes": [
0.000
],
"writeBytes": [
0.000
],
"runningSpeed": [
0.000
],
"transmittedBytes": [
0.000
]
}
]
}
},
{
"id": 2,
"uuid": "2BA128CE-38E4-4522-B823-7471633C2717",
"name": "VIOS2",
"state": "Running",
"affinityScore": 100,
"memory": {
"assignedMem": [
8192.000
],
"utilizedMem": [
2090.000
]
},
"processor": {
"weight": 0,
"mode": "share_idle_procs_active",
"maxVirtualProcessors": [
2.000
],
"currentVirtualProcessors": [
0.000
],
"maxProcUnits": [
2.000
],
"entitledProcUnits": [
1.000
],
"utilizedProcUnits": [
0.005
],
"utilizedCappedProcUnits": [
0.042
],
"utilizedUncappedProcUnits": [
0.000
],
"idleProcUnits": [
0.037
],
"donatedProcUnits": [
0.958
],
"timeSpentWaitingForDispatch": [
0.000
],
"timePerInstructionExecution": [
52.000
]
},
"network": {
"genericAdapters": [
{
"id": "ent6",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V2-C3-T1",
"receivedPackets": [
12.233
],
"sentPackets": [
9.000
],
"droppedPackets": [
0.000
],
"sentBytes": [
3011.200
],
"receivedBytes": [
2265.067
],
"transferredBytes": [
5276.267
]
},
{
"id": "ent4",
"type": "virtual",
"physicalLocation": "U8247.22L.213C1BA-V2-C2-T1",
"receivedPackets": [
4.600
],
"sentPackets": [
1.000
],
"droppedPackets": [
0.000
],
"sentBytes": [
706.000
],
"receivedBytes": [
3247.600
],
"transferredBytes": [
3953.600
]
},
{
"id": "ent2",
"type": "physical",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C6-T3",
"receivedPackets": [
5.167
],
"sentPackets": [
0.000
],
"droppedPackets": [
0.000
],
"sentBytes": [
0.000
],
"receivedBytes": [
380.333
],
"transferredBytes": [
380.333
]
}
],
"sharedAdapters": [
{
"id": "ent5",
"type": "sea",
"physicalLocation": "U8247.22L.213C1BA-V2-C2-T1",
"receivedPackets": [
9.767
],
"sentPackets": [
1.000
],
"droppedPackets": [
0.000
],
"sentBytes": [
706.000
],
"receivedBytes": [
3627.933
],
"transferredBytes": [
4333.933
],
"bridgedAdapters": [
"ent2",
"ent4",
"ent4"
]
}
],
"virtualEthernetAdapters": [
{
"physicalLocation": "U8247.22L.213C1BA-V2-C2",
"vlanId": 1,
"vswitchId": 0,
"isPortVlanId": true,
"receivedPackets": [
0.000
],
"sentPackets": [
0.000
],
"droppedPackets": [
0.000
],
"sentBytes": [
0.000
],
"receivedBytes": [
0.000
],
"receivedPhysicalPackets": [
0.000
],
"sentPhysicalPackets": [
0.000
],
"droppedPhysicalPackets": [
0.000
],
"sentPhysicalBytes": [
0.000
],
"receivedPhysicalBytes": [
0.000
],
"transferredBytes": [
0.000
],
"transferredPhysicalBytes": [
0.000
]
},
{
"physicalLocation": "U8247.22L.213C1BA-V2-C3",
"vlanId": 1,
"vswitchId": 0,
"isPortVlanId": true,
"receivedPackets": [
5.867
],
"sentPackets": [
1.567
],
"droppedPackets": [
0.000
],
"sentBytes": [
1306.633
],
"receivedBytes": [
517.900
],
"receivedPhysicalPackets": [
5.867
],
"sentPhysicalPackets": [
1.567
],
"droppedPhysicalPackets": [
0.000
],
"sentPhysicalBytes": [
1306.633
],
"receivedPhysicalBytes": [
517.900
],
"transferredBytes": [
1824.533
],
"transferredPhysicalBytes": [
1824.533
]
}
]
},
"storage": {
"clientLpars": [
"62F4D488-C838-41E2-B83B-E68E004E3B63"
],
"genericPhysicalAdapters": [
{
"id": "sissas1",
"type": "sas",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C15-T1",
"numOfReads": [
0.000
],
"numOfWrites": [
6.400
],
"readBytes": [
0.000
],
"writeBytes": [
3276.800
],
"transmittedBytes": [
3276.800
]
}
],
"fiberChannelAdapters": [
{
"id": "fcs1",
"wwpn": "10000090fab674d7",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C2-T2",
"numOfPorts": 0,
"numOfReads": [
0.000
],
"numOfWrites": [
0.000
],
"readBytes": [
0.000
],
"writeBytes": [
0.000
],
"runningSpeed": [
0.000
],
"transmittedBytes": [
0.000
]
},
{
"id": "fcs0",
"wwpn": "10000090fab674d6",
"physicalLocation": "U78CB.001.WZS0BYF-P1-C2-T1",
"numOfPorts": 3,
"numOfReads": [
0.000
],
"numOfWrites": [
0.400
],
"readBytes": [
0.000
],
"writeBytes": [
26214.400
],
"runningSpeed": [
8.000
],
"transmittedBytes": [
26214.400
]
}
]
}
}
]
*/
} }