Merged in development (pull request #10)

Added VIOS memory and processor metrics.
This commit is contained in:
Mark Nellemann 2020-12-16 11:38:46 +00:00
commit a02b1a845c
6 changed files with 451 additions and 21 deletions

View file

@ -48,9 +48,351 @@
"gnetId": 1465, "gnetId": 1465,
"graphTooltip": 0, "graphTooltip": 0,
"id": null, "id": null,
"iteration": 1607681505084, "iteration": 1608117267608,
"links": [], "links": [],
"panels": [ "panels": [
{
"aliasColors": {},
"bars": false,
"content": "",
"dashLength": 10,
"dashes": false,
"datasource": "${DS_HMCI}",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {},
"links": []
},
"overrides": []
},
"fill": 2,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 12,
"w": 12,
"x": 0,
"y": 0
},
"hiddenSeries": false,
"id": 16,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"mode": "",
"nullPointMode": "connected",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.3.1",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"style": {},
"targets": [
{
"alias": "$tag_vios: $tag_name",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"vios"
],
"type": "tag"
},
{
"params": [
"name"
],
"type": "tag"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"measurement": "SystemViosMemory",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "system",
"operator": "=~",
"value": "/^$ManagedSystem$/"
},
{
"condition": "AND",
"key": "vios",
"operator": "=~",
"value": "/^$Vios$/"
},
{
"condition": "AND",
"key": "name",
"operator": "=~",
"value": "/Mem/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$ManagedSystem - $Vios - Memory",
"tooltip": {
"msResolution": false,
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:2511",
"format": "decmbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:2512",
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"content": "",
"dashLength": 10,
"dashes": false,
"datasource": "${DS_HMCI}",
"editable": true,
"error": false,
"fieldConfig": {
"defaults": {
"custom": {},
"links": []
},
"overrides": []
},
"fill": 2,
"fillGradient": 0,
"grid": {},
"gridPos": {
"h": 12,
"w": 12,
"x": 12,
"y": 0
},
"hiddenSeries": false,
"id": 19,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": true,
"min": false,
"rightSide": false,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 2,
"links": [],
"mode": "",
"nullPointMode": "connected",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.3.1",
"pointradius": 5,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"style": {},
"targets": [
{
"alias": "$tag_vios: $tag_name",
"dsType": "influxdb",
"groupBy": [
{
"params": [
"$interval"
],
"type": "time"
},
{
"params": [
"vios"
],
"type": "tag"
},
{
"params": [
"name"
],
"type": "tag"
},
{
"params": [
"null"
],
"type": "fill"
}
],
"hide": false,
"measurement": "SystemViosProcessor",
"orderByTime": "ASC",
"policy": "default",
"refId": "A",
"resultFormat": "time_series",
"select": [
[
{
"params": [
"value"
],
"type": "field"
},
{
"params": [],
"type": "mean"
}
]
],
"tags": [
{
"key": "system",
"operator": "=~",
"value": "/^$ManagedSystem$/"
},
{
"condition": "AND",
"key": "vios",
"operator": "=~",
"value": "/^$Vios$/"
},
{
"condition": "AND",
"key": "name",
"operator": "=~",
"value": "/ProcUnits$/"
}
]
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "$ManagedSystem - $Vios - Processors",
"tooltip": {
"msResolution": false,
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"$$hashKey": "object:2511",
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"$$hashKey": "object:2512",
"format": "none",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{ {
"aliasColors": {}, "aliasColors": {},
"bars": false, "bars": false,
@ -74,10 +416,10 @@
"h": 8, "h": 8,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 0 "y": 12
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 16, "id": 18,
"legend": { "legend": {
"alignAsTable": true, "alignAsTable": true,
"avg": true, "avg": true,
@ -252,7 +594,7 @@
"h": 8, "h": 8,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 8 "y": 20
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 17, "id": 17,
@ -423,7 +765,7 @@
"h": 8, "h": 8,
"w": 24, "w": 24,
"x": 0, "x": 0,
"y": 16 "y": 28
}, },
"hiddenSeries": false, "hiddenSeries": false,
"id": 11, "id": 11,
@ -668,5 +1010,5 @@
"timezone": "browser", "timezone": "browser",
"title": "IBM Power - HMC Managed Systems - Virtual I/O Servers", "title": "IBM Power - HMC Managed Systems - Virtual I/O Servers",
"uid": "DDNEv5vGz", "uid": "DDNEv5vGz",
"version": 2 "version": 4
} }

View file

@ -1,3 +1,3 @@
id = hmci id = hmci
group = biz.nellemann.hmci group = biz.nellemann.hmci
version = 0.2.5 version = 0.2.6

View file

@ -125,9 +125,9 @@ class InfluxClient {
getSystemSharedProcessorPools(system, timestamp).forEach( it -> batchPoints.point(it) ); getSystemSharedProcessorPools(system, timestamp).forEach( it -> batchPoints.point(it) );
getSystemSharedAdapters(system, timestamp).forEach( it -> batchPoints.point(it) ); getSystemSharedAdapters(system, timestamp).forEach( it -> batchPoints.point(it) );
getSystemFiberChannelAdapters(system, timestamp).forEach( it -> batchPoints.point(it) ); getSystemFiberChannelAdapters(system, timestamp).forEach( it -> batchPoints.point(it) );
//getSystemGenericPhysicalAdapters(system, timestamp).forEach( it -> batchPoints.point(it) );
//getSystemGenericVirtualAdapters(system, timestamp).forEach( it -> batchPoints.point(it) );
getSystemVirtualEthernetAdapters(system, timestamp).forEach( it -> batchPoints.point(it) ); getSystemVirtualEthernetAdapters(system, timestamp).forEach( it -> batchPoints.point(it) );
getSystemViosMemory(system, timestamp).forEach( it -> batchPoints.point(it) );
getSystemViosProcessor(system, timestamp).forEach( it -> batchPoints.point(it) );
} }
@ -157,23 +157,21 @@ class InfluxClient {
return processMeasurementMap(metrics, timestamp, "SystemFiberChannelAdapters"); return processMeasurementMap(metrics, timestamp, "SystemFiberChannelAdapters");
} }
/*
private static List<Point> getSystemGenericPhysicalAdapters(ManagedSystem system, Instant timestamp) {
List<Measurement> metrics = system.getSystemGenericPhysicalAdapters();
return processMeasurementMap(metrics, timestamp, "SystemGenericPhysicalAdapters");
}
private static List<Point> getSystemGenericVirtualAdapters(ManagedSystem system, Instant timestamp) {
List<Measurement> metrics = system.getSystemGenericVirtualAdapters();
return processMeasurementMap(metrics, timestamp, "SystemGenericVirtualAdapters");
}
*/
private static List<Point> getSystemVirtualEthernetAdapters(ManagedSystem system, Instant timestamp) { private static List<Point> getSystemVirtualEthernetAdapters(ManagedSystem system, Instant timestamp) {
List<Measurement> metrics = system.getSystemVirtualEthernetAdapters(); List<Measurement> metrics = system.getSystemVirtualEthernetAdapters();
return processMeasurementMap(metrics, timestamp, "SystemVirtualEthernetAdapters"); return processMeasurementMap(metrics, timestamp, "SystemVirtualEthernetAdapters");
} }
private static List<Point> getSystemViosMemory(ManagedSystem system, Instant timestamp) {
List<Measurement> metrics = system.getViosMemoryMetrics();
return processMeasurementMap(metrics, timestamp, "SystemViosMemory");
}
private static List<Point> getSystemViosProcessor(ManagedSystem system, Instant timestamp) {
List<Measurement> metrics = system.getViosProcessorMetrics();
return processMeasurementMap(metrics, timestamp, "SystemViosProcessor");
}
/* /*
Logical Partitions Logical Partitions

View file

@ -114,6 +114,59 @@ class ManagedSystem extends MetaSystem {
return list; return list;
} }
// VIOs Memory
List<Measurement> getViosMemoryMetrics() {
List<Measurement> list = new ArrayList<>();
metrics.systemUtil.sample.viosUtil.forEach(vios -> {
HashMap<String, String> tagsMap = new HashMap<String, String>();
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
log.debug("getViosMemoryMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
fieldsMap.put("assignedMem", vios.memory.assignedMem);
fieldsMap.put("utilizedMem", vios.memory.utilizedMem);
log.debug("getViosMemoryMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
return list;
}
// VIOs Processor
List<Measurement> getViosProcessorMetrics() {
List<Measurement> list = new ArrayList<>();
metrics.systemUtil.sample.viosUtil.forEach(vios -> {
HashMap<String, String> tagsMap = new HashMap<String, String>();
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
log.debug("getViosProcessorMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
fieldsMap.put("utilizedProcUnits", vios.processor.utilizedProcUnits);
fieldsMap.put("maxVirtualProcessors", vios.processor.maxVirtualProcessors);
fieldsMap.put("currentVirtualProcessors", vios.processor.currentVirtualProcessors);
fieldsMap.put("entitledProcUnits", vios.processor.entitledProcUnits);
fieldsMap.put("utilizedCappedProcUnits", vios.processor.utilizedCappedProcUnits);
fieldsMap.put("utilizedUncappedProcUnits", vios.processor.utilizedUncappedProcUnits);
fieldsMap.put("timePerInstructionExecution", vios.processor.timeSpentWaitingForDispatch);
fieldsMap.put("timeSpentWaitingForDispatch", vios.processor.timePerInstructionExecution);
log.debug("getViosProcessorMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
return list;
}
// VIOs // VIOs
List<Measurement> getSystemSharedAdapters() { List<Measurement> getSystemSharedAdapters() {

View file

@ -7,6 +7,9 @@ public class LparMemory {
@FirstElement @FirstElement
public Number logicalMem; public Number logicalMem;
@FirstElement
public Number utilizedMem;
@FirstElement @FirstElement
public Number backedPhysicalMem; public Number backedPhysicalMem;

View file

@ -88,4 +88,38 @@ class ManagedSystemTest extends Specification {
listOfMeasurements.first().fields['assignedProcUnits'] == 23.767 listOfMeasurements.first().fields['assignedProcUnits'] == 23.767
} }
void "test getViosMemoryMetrics"() {
setup:
def testFile = new File(getClass().getResource('/pcm-data-managed-system.json').toURI())
def testJson = testFile.getText('UTF-8')
ManagedSystem system = new ManagedSystem("site1", "e09834d1-c930-3883-bdad-405d8e26e166", "Test Name","Test Type", "Test Model", "Test S/N")
when:
system.processMetrics(testJson)
List<Measurement> listOfMeasurements = system.getViosMemoryMetrics()
then:
listOfMeasurements.size() == 2
listOfMeasurements.first().fields['assignedMem'] == 8192.000
listOfMeasurements.first().fields['utilizedMem'] == 2093.000
}
void "test getViosProcessorMetrics"() {
setup:
def testFile = new File(getClass().getResource('/pcm-data-managed-system.json').toURI())
def testJson = testFile.getText('UTF-8')
ManagedSystem system = new ManagedSystem("site1", "e09834d1-c930-3883-bdad-405d8e26e166", "Test Name","Test Type", "Test Model", "Test S/N")
when:
system.processMetrics(testJson)
List<Measurement> listOfMeasurements = system.getViosProcessorMetrics()
then:
listOfMeasurements.size() == 2
listOfMeasurements.first().fields['entitledProcUnits'] == 1.0
listOfMeasurements.first().fields['utilizedCappedProcUnits'] == 0.12
}
} }