diff --git a/doc/IBM Power - HMC Managed Systems - Virtual I_O Servers-1607681513373.json b/doc/IBM Power - HMC Managed Systems - Virtual I_O Servers-1608118380821.json similarity index 66% rename from doc/IBM Power - HMC Managed Systems - Virtual I_O Servers-1607681513373.json rename to doc/IBM Power - HMC Managed Systems - Virtual I_O Servers-1608118380821.json index 350c126..8695bbf 100644 --- a/doc/IBM Power - HMC Managed Systems - Virtual I_O Servers-1607681513373.json +++ b/doc/IBM Power - HMC Managed Systems - Virtual I_O Servers-1608118380821.json @@ -48,9 +48,351 @@ "gnetId": 1465, "graphTooltip": 0, "id": null, - "iteration": 1607681505084, + "iteration": 1608117267608, "links": [], "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": {}, "bars": false, @@ -74,10 +416,10 @@ "h": 8, "w": 24, "x": 0, - "y": 0 + "y": 12 }, "hiddenSeries": false, - "id": 16, + "id": 18, "legend": { "alignAsTable": true, "avg": true, @@ -252,7 +594,7 @@ "h": 8, "w": 24, "x": 0, - "y": 8 + "y": 20 }, "hiddenSeries": false, "id": 17, @@ -423,7 +765,7 @@ "h": 8, "w": 24, "x": 0, - "y": 16 + "y": 28 }, "hiddenSeries": false, "id": 11, @@ -668,5 +1010,5 @@ "timezone": "browser", "title": "IBM Power - HMC Managed Systems - Virtual I/O Servers", "uid": "DDNEv5vGz", - "version": 2 + "version": 4 } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 0233858..eea024d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ id = hmci group = biz.nellemann.hmci -version = 0.2.5 +version = 0.2.6 diff --git a/src/main/java/biz/nellemann/hmci/InfluxClient.java b/src/main/java/biz/nellemann/hmci/InfluxClient.java index c97d035..b5c2e48 100644 --- a/src/main/java/biz/nellemann/hmci/InfluxClient.java +++ b/src/main/java/biz/nellemann/hmci/InfluxClient.java @@ -125,9 +125,9 @@ class InfluxClient { getSystemSharedProcessorPools(system, timestamp).forEach( it -> batchPoints.point(it) ); getSystemSharedAdapters(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) ); + 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"); } -/* - private static List getSystemGenericPhysicalAdapters(ManagedSystem system, Instant timestamp) { - List metrics = system.getSystemGenericPhysicalAdapters(); - return processMeasurementMap(metrics, timestamp, "SystemGenericPhysicalAdapters"); - } - - private static List getSystemGenericVirtualAdapters(ManagedSystem system, Instant timestamp) { - List metrics = system.getSystemGenericVirtualAdapters(); - return processMeasurementMap(metrics, timestamp, "SystemGenericVirtualAdapters"); - } - */ - private static List getSystemVirtualEthernetAdapters(ManagedSystem system, Instant timestamp) { List metrics = system.getSystemVirtualEthernetAdapters(); return processMeasurementMap(metrics, timestamp, "SystemVirtualEthernetAdapters"); } + private static List getSystemViosMemory(ManagedSystem system, Instant timestamp) { + List metrics = system.getViosMemoryMetrics(); + return processMeasurementMap(metrics, timestamp, "SystemViosMemory"); + } + + private static List getSystemViosProcessor(ManagedSystem system, Instant timestamp) { + List metrics = system.getViosProcessorMetrics(); + return processMeasurementMap(metrics, timestamp, "SystemViosProcessor"); + } + /* Logical Partitions diff --git a/src/main/java/biz/nellemann/hmci/ManagedSystem.java b/src/main/java/biz/nellemann/hmci/ManagedSystem.java index 13dbe2d..1fb32f7 100644 --- a/src/main/java/biz/nellemann/hmci/ManagedSystem.java +++ b/src/main/java/biz/nellemann/hmci/ManagedSystem.java @@ -114,6 +114,59 @@ class ManagedSystem extends MetaSystem { return list; } + + // VIOs Memory + List getViosMemoryMetrics() { + + List list = new ArrayList<>(); + metrics.systemUtil.sample.viosUtil.forEach(vios -> { + + HashMap tagsMap = new HashMap(); + tagsMap.put("system", name); + tagsMap.put("vios", vios.name); + log.debug("getViosMemoryMetrics() - tags: " + tagsMap.toString()); + + HashMap fieldsMap = new HashMap(); + 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 getViosProcessorMetrics() { + + List list = new ArrayList<>(); + metrics.systemUtil.sample.viosUtil.forEach(vios -> { + + HashMap tagsMap = new HashMap(); + tagsMap.put("system", name); + tagsMap.put("vios", vios.name); + log.debug("getViosProcessorMetrics() - tags: " + tagsMap.toString()); + + HashMap fieldsMap = new HashMap(); + 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 List getSystemSharedAdapters() { diff --git a/src/main/java/biz/nellemann/hmci/pcm/LparMemory.java b/src/main/java/biz/nellemann/hmci/pcm/LparMemory.java index 1ab35f0..479a579 100644 --- a/src/main/java/biz/nellemann/hmci/pcm/LparMemory.java +++ b/src/main/java/biz/nellemann/hmci/pcm/LparMemory.java @@ -7,6 +7,9 @@ public class LparMemory { @FirstElement public Number logicalMem; + @FirstElement + public Number utilizedMem; + @FirstElement public Number backedPhysicalMem; diff --git a/src/test/groovy/biz/nellemann/hmci/ManagedSystemTest.groovy b/src/test/groovy/biz/nellemann/hmci/ManagedSystemTest.groovy index 5359685..d26e2b5 100644 --- a/src/test/groovy/biz/nellemann/hmci/ManagedSystemTest.groovy +++ b/src/test/groovy/biz/nellemann/hmci/ManagedSystemTest.groovy @@ -88,4 +88,38 @@ class ManagedSystemTest extends Specification { 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 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 listOfMeasurements = system.getViosProcessorMetrics() + + then: + listOfMeasurements.size() == 2 + listOfMeasurements.first().fields['entitledProcUnits'] == 1.0 + listOfMeasurements.first().fields['utilizedCappedProcUnits'] == 0.12 + } + }