From 2967f6ef7545295ad70e546ab3c80183e3ee2255 Mon Sep 17 00:00:00 2001 From: Mark Nellemann Date: Tue, 21 Mar 2023 14:57:00 +0100 Subject: [PATCH] Cleanup and dashboard fixes and improvements. --- CHANGELOG.md | 27 +- .../HMCi - Power LPAR Overview.json | 9 +- .../HMCi - Power LPAR Utilization.json | 30 +- .../HMCi - Power System Overview.json | 627 +++++++++++------- .../HMCi - Power System Utilization.json | 16 +- doc/dashboards/HMCi - Power VIO Overview.json | 15 +- .../HMCi - Power VIO Utilization.json | 40 +- gradle.properties | 2 +- .../java/biz/nellemann/hmci/InfluxClient.java | 25 - .../biz/nellemann/hmci/ManagementConsole.java | 1 - .../java/biz/nellemann/hmci/Resource.java | 10 +- .../java/biz/nellemann/hmci/RestClient.java | 2 - .../hmci/dto/json/SystemFirmware.java | 1 - .../biz/nellemann/hmci/dto/xml/XmlEntry.java | 1 - .../biz/nellemann/hmci/dto/xml/XmlFeed.java | 2 - 15 files changed, 455 insertions(+), 353 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1f4772..2c1a202 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,40 +2,35 @@ All notable changes to this project will be documented in this file. -## [1.4.2] - 2023-01-05 +## 1.4.3 - 2023-03-21 +- Fix and improve processor utilization dashboards. +- Minor code cleanup. + +## 1.4.2 - 2023-01-05 - Fix error in SR-IOV port type being null. -## [1.4.1] - 2022-12-15 +## 1.4.1 - 2022-12-15 - Retrieve multiple PCM samples and keep track of processing. - Rename VIOS metric 'vFC' (storage adapter) to 'virtual'. -## [1.4.0] - 2022-12-01 +## 1.4.0 - 2022-12-01 - Rewrite of toml+xml+json de-serialization code (uses jackson now). - Changes to configuration file format - please look at [doc/hmci.toml](doc/hmci.toml) as example. - Logging (write to file) JSON output from HMC is currently not possible. -## [1.3.3] - 2022-09-20 +## 1.3.3 - 2022-09-20 - Default configuration location on Windows platform. - Process LPAR SR-IOV logical network ports data - Update default dashboards - Update documentation -## [1.3.0] - 2022-02-04 +## 1.3.0 - 2022-02-04 - Correct use of InfluxDB batch writing. -## [1.2.8] - 2022-02-28 +## 1.2.8 - 2022-02-28 - Sort measurement tags before writing to InfluxDB. - Update 3rd party dependencies. -## [1.2.7] - 2022-02-24 +## 1.2.7 - 2022-02-24 - Options to include/exclude Managed Systems and/or Logical Partitions. - -[1.4.2]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.4.2%0Dv1.4.1 -[1.4.1]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.4.1%0Dv1.4.0 -[1.4.0]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.4.0%0Dv1.3.3 -[1.3.3]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.3.3%0Dv1.3.0 -[1.3.0]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.3.0%0Dv1.2.8 -[1.2.8]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.2.8%0Dv1.2.7 -[1.2.7]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.2.7%0Dv1.2.6 -[1.2.6]: https://bitbucket.org/mnellemann/hmci/branches/compare/v1.2.6%0Dv1.2.5 diff --git a/doc/dashboards/HMCi - Power LPAR Overview.json b/doc/dashboards/HMCi - Power LPAR Overview.json index 895e4e1..a6339b8 100644 --- a/doc/dashboards/HMCi - Power LPAR Overview.json +++ b/doc/dashboards/HMCi - Power LPAR Overview.json @@ -390,7 +390,7 @@ "measurement": "lpar_details", "orderByTime": "ASC", "policy": "default", - "query": "SELECT last(\"weight\") AS \"Weight\", last(\"mode\") AS \"Mode\", last(\"entitledProcUnits\") AS \"eCPU\", mean(\"utilizedProcUnits\") / mean(\"entitledProcUnits\")*100 AS \"Utilization eCPU\", last(\"currentVirtualProcessors\") AS \"vCPU\", mean(\"utilizedProcUnits\") / mean(\"maxProcUnits\") * 100 AS \"Utilization vCPU\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/) AND (\"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY \"lparname\" fill(previous)", + "query": "SELECT last(\"weight\") AS \"Weight\", last(\"mode\") AS \"Mode\", last(\"entitledProcUnits\") AS \"eCPU\", mean(\"utilizedProcUnits\") / mean(\"entitledProcUnits\")*100 AS \"Utilization eCPU\", last(\"currentVirtualProcessors\") AS \"vCPU\", mean(\"utilizedProcUnits\") / mean(\"currentVirtualProcessors\") * 100 AS \"Utilization vCPU\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/) AND (\"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY \"lparname\" fill(previous)", "queryType": "randomWalk", "rawQuery": true, "refId": "A", @@ -534,6 +534,7 @@ "type": "influxdb", "uid": "${DS_HMCI}" }, + "description": "", "fieldConfig": { "defaults": { "color": { @@ -640,7 +641,7 @@ "measurement": "/^$ServerName$/", "orderByTime": "ASC", "policy": "default", - "query": "SELECT (mean(\"utilizedProcUnits\") / mean(\"maxProcUnits\")) * 100 AS \"usage\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY time($interval), \"lparname\", \"servername\" fill(linear)", + "query": "SELECT (mean(\"utilizedProcUnits\") / mean(\"entitledProcUnits\")) * 100 AS \"usage\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY time($interval), \"lparname\", \"servername\" fill(linear)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -661,7 +662,7 @@ "tags": [] } ], - "title": "Processor Units - Utilization Percentage", + "title": "Processor Units - Utilization / Entitled Percentage", "transformations": [], "type": "timeseries" }, @@ -2710,6 +2711,6 @@ "timezone": "browser", "title": "HMCi - Power LPAR Overview", "uid": "Xl7oHESGz", - "version": 4, + "version": 3, "weekStart": "" } diff --git a/doc/dashboards/HMCi - Power LPAR Utilization.json b/doc/dashboards/HMCi - Power LPAR Utilization.json index 52dfd53..7ac4402 100644 --- a/doc/dashboards/HMCi - Power LPAR Utilization.json +++ b/doc/dashboards/HMCi - Power LPAR Utilization.json @@ -1,7 +1,7 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", + "name": "DS_HMCI", "label": "Database", "description": "", "type": "datasource", @@ -15,7 +15,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "9.1.3" + "version": "9.1.6" }, { "type": "datasource", @@ -71,7 +71,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "gridPos": { "h": 3, @@ -84,12 +84,12 @@ "content": "## Metrics collected from IBM Power HMC\n \nFor more information visit: [git.data.coop/nellemann/hmci](https://git.data.coop/nellemann/hmci)\n ", "mode": "markdown" }, - "pluginVersion": "9.1.3", + "pluginVersion": "9.1.6", "targets": [ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "refId": "A" } @@ -100,7 +100,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -189,7 +189,7 @@ "alias": "$tag_lparname", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "groupBy": [ { @@ -209,7 +209,7 @@ "measurement": "/^$ServerName$/", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"utilizedProcUnits\") / mean(\"maxProcUnits\") AS \"usage\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY time($interval), \"lparname\", \"servername\" fill(none)", + "query": "SELECT mean(\"utilizedProcUnits\") / mean(\"currentVirtualProcessors\") AS \"usage\" FROM \"lpar_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"lparname\" =~ /^$LPAR$/) AND $timeFilter GROUP BY time($interval), \"lparname\", \"servername\" fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -237,7 +237,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -319,7 +319,7 @@ "alias": "$tag_servername - $tag_lparname ($col)", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ @@ -419,7 +419,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -497,7 +497,7 @@ "alias": "$tag_servername - $tag_lparname ($col)", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ @@ -620,7 +620,7 @@ "current": {}, "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "definition": "SHOW TAG VALUES FROM \"server_processor\" WITH KEY = \"servername\" WHERE time > now() - 24h", "hide": 0, @@ -644,7 +644,7 @@ "current": {}, "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "definition": "SHOW TAG VALUES FROM \"lpar_processor\" WITH KEY = \"lparname\" WHERE servername =~ /$ServerName/", "hide": 0, @@ -697,6 +697,6 @@ "timezone": "browser", "title": "HMCi - Power LPAR Utilization", "uid": "jFsbpTH4k", - "version": 4, + "version": 2, "weekStart": "" } diff --git a/doc/dashboards/HMCi - Power System Overview.json b/doc/dashboards/HMCi - Power System Overview.json index d612035..2cb4f27 100644 --- a/doc/dashboards/HMCi - Power System Overview.json +++ b/doc/dashboards/HMCi - Power System Overview.json @@ -115,6 +115,370 @@ "transparent": true, "type": "text" }, + { + "datasource": { + "type": "influxdb", + "uid": "${DS_HMCI}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "cores", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 2, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 0, + "y": 3 + }, + "id": 31, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "8.1.4", + "targets": [ + { + "alias": "$col", + "datasource": { + "type": "influxdb", + "uid": "${DS_HMCI}" + }, + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "servername" + ], + "type": "tag" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "server_processor", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "utilizedProcUnits" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "utlized" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "totalProcUnits" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "total" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "availableProcUnits" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "available" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "configurableProcUnits" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "configurable" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "servername", + "operator": "=~", + "value": "/^$ServerName$/" + } + ] + } + ], + "title": "System Processor Utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "influxdb", + "uid": "${DS_HMCI}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Memory", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "opacity", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decmbytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 6, + "w": 12, + "x": 12, + "y": 3 + }, + "id": 2, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "8.1.4", + "targets": [ + { + "alias": "$col", + "datasource": { + "type": "influxdb", + "uid": "${DS_HMCI}" + }, + "dsType": "influxdb", + "groupBy": [ + { + "params": [ + "$interval" + ], + "type": "time" + }, + { + "params": [ + "servername" + ], + "type": "tag" + }, + { + "params": [ + "none" + ], + "type": "fill" + } + ], + "hide": false, + "measurement": "server_memory", + "orderByTime": "ASC", + "policy": "default", + "refId": "A", + "resultFormat": "time_series", + "select": [ + [ + { + "params": [ + "assignedMemToLpars" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "assigned" + ], + "type": "alias" + } + ], + [ + { + "params": [ + "availableMem" + ], + "type": "field" + }, + { + "params": [], + "type": "mean" + }, + { + "params": [ + "available" + ], + "type": "alias" + } + ] + ], + "tags": [ + { + "key": "servername", + "operator": "=~", + "value": "/^$ServerName$/" + } + ] + } + ], + "title": "System Memory Utilization", + "type": "timeseries" + }, { "datasource": { "type": "influxdb", @@ -181,7 +545,7 @@ "h": 9, "w": 15, "x": 0, - "y": 3 + "y": 9 }, "id": 19, "links": [], @@ -304,7 +668,7 @@ "h": 9, "w": 5, "x": 15, - "y": 3 + "y": 9 }, "id": 29, "options": { @@ -379,7 +743,7 @@ ] } ], - "title": "Shared Processor Pools - Utilization / Assigned", + "title": "Shared Processor Pools - Utilization", "type": "stat" }, { @@ -418,7 +782,7 @@ "h": 9, "w": 4, "x": 20, - "y": 3 + "y": 9 }, "id": 30, "options": { @@ -491,7 +855,7 @@ ] } ], - "title": "Processors - Utilization / Total", + "title": "System Processors - Utilization", "type": "gauge" }, { @@ -554,9 +918,9 @@ }, "gridPos": { "h": 9, - "w": 8, + "w": 12, "x": 0, - "y": 12 + "y": 18 }, "id": 27, "links": [], @@ -753,212 +1117,11 @@ }, "gridPos": { "h": 9, - "w": 8, - "x": 8, - "y": 12 + "w": 12, + "x": 12, + "y": 18 }, - "id": 31, - "links": [], - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "8.1.4", - "targets": [ - { - "alias": "$col", - "datasource": { - "type": "influxdb", - "uid": "${DS_HMCI}" - }, - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "$interval" - ], - "type": "time" - }, - { - "params": [ - "servername" - ], - "type": "tag" - }, - { - "params": [ - "none" - ], - "type": "fill" - } - ], - "hide": false, - "measurement": "server_processor", - "orderByTime": "ASC", - "policy": "default", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "utilizedProcUnits" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "utlized" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "totalProcUnits" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "total" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "availableProcUnits" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "available" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "configurableProcUnits" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "configured" - ], - "type": "alias" - } - ] - ], - "tags": [ - { - "key": "servername", - "operator": "=~", - "value": "/^$ServerName$/" - } - ] - } - ], - "title": "Processor - Core Utilization", - "type": "timeseries" - }, - { - "datasource": { - "type": "influxdb", - "uid": "${DS_HMCI}" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "Memory", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "links": [], - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "decmbytes" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 8, - "x": 16, - "y": 12 - }, - "id": 2, + "id": 35, "links": [], "options": { "legend": { @@ -975,7 +1138,7 @@ "pluginVersion": "8.1.4", "targets": [ { - "alias": "$col", + "alias": "$tag_poolname", "datasource": { "type": "influxdb", "uid": "${DS_HMCI}" @@ -990,7 +1153,7 @@ }, { "params": [ - "servername" + "poolname" ], "type": "tag" }, @@ -1002,7 +1165,7 @@ } ], "hide": false, - "measurement": "server_memory", + "measurement": "server_sharedProcessorPool", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -1011,7 +1174,7 @@ [ { "params": [ - "assignedMemToLpars" + "availableProcUnits" ], "type": "field" }, @@ -1021,25 +1184,7 @@ }, { "params": [ - "assigned" - ], - "type": "alias" - } - ], - [ - { - "params": [ - "availableMem" - ], - "type": "field" - }, - { - "params": [], - "type": "mean" - }, - { - "params": [ - "available" + "utlized" ], "type": "alias" } @@ -1054,7 +1199,7 @@ ] } ], - "title": "Memory Utilization", + "title": "Shared Processor Pools - Core Utilization", "type": "timeseries" }, { @@ -1150,7 +1295,7 @@ "h": 9, "w": 12, "x": 0, - "y": 21 + "y": 27 }, "id": 11, "links": [], @@ -1297,7 +1442,7 @@ "h": 9, "w": 12, "x": 12, - "y": 21 + "y": 27 }, "id": 16, "links": [], @@ -1414,7 +1559,7 @@ "h": 10, "w": 12, "x": 0, - "y": 30 + "y": 36 }, "id": 26, "options": { @@ -1614,7 +1759,7 @@ "h": 10, "w": 6, "x": 12, - "y": 30 + "y": 36 }, "id": 34, "options": { @@ -1749,7 +1894,7 @@ "h": 10, "w": 6, "x": 18, - "y": 30 + "y": 36 }, "id": 22, "options": { diff --git a/doc/dashboards/HMCi - Power System Utilization.json b/doc/dashboards/HMCi - Power System Utilization.json index 3a6a63b..9bd9ab6 100644 --- a/doc/dashboards/HMCi - Power System Utilization.json +++ b/doc/dashboards/HMCi - Power System Utilization.json @@ -1,7 +1,7 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", + "name": "DS_HMCI", "label": "Database", "description": "", "type": "datasource", @@ -90,7 +90,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "gridPos": { "h": 3, @@ -108,7 +108,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "refId": "A" } @@ -147,7 +147,7 @@ "alias": "$tag_servername", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "groupBy": [ { @@ -273,7 +273,7 @@ "alias": "$tag_servername", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "groupBy": [ { @@ -381,7 +381,7 @@ "alias": "$tag_servername", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "groupBy": [ { @@ -482,7 +482,7 @@ "alias": "$tag_servername", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "groupBy": [ { @@ -597,7 +597,7 @@ "alias": "$tag_servername", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ diff --git a/doc/dashboards/HMCi - Power VIO Overview.json b/doc/dashboards/HMCi - Power VIO Overview.json index e4b58af..853214f 100644 --- a/doc/dashboards/HMCi - Power VIO Overview.json +++ b/doc/dashboards/HMCi - Power VIO Overview.json @@ -445,12 +445,7 @@ "show": false }, "showHeader": true, - "sortBy": [ - { - "desc": true, - "displayName": "Utilization" - } - ] + "sortBy": [] }, "pluginVersion": "9.1.6", "targets": [ @@ -472,7 +467,7 @@ "measurement": "lpar_details", "orderByTime": "ASC", "policy": "default", - "query": "SELECT last(\"weight\") AS \"Weight\", last(\"entitledProcUnits\") AS \"Entitled\", last(\"currentVirtualProcessors\") AS \"VP\", (last(\"utilizedProcUnits\") / last(\"maxProcUnits\")) * 100 AS \"Utilization\", last(\"mode\") AS \"Mode\" FROM \"vios_processor\" WHERE (\"servername\" =~ /^$ServerName$/) AND (\"viosname\" =~ /^$ViosName$/) AND $timeFilter GROUP BY \"viosname\" fill(previous)", + "query": "SELECT last(\"weight\") AS \"Weight\", last(\"entitledProcUnits\") AS \"Entitled\", last(\"currentVirtualProcessors\") AS \"VP\", (mean(\"utilizedProcUnits\") / mean(\"entitledProcUnits\")) * 100 AS \"Utilization\", last(\"mode\") AS \"Mode\" FROM \"vios_processor\" WHERE (\"servername\" =~ /^$ServerName$/) AND (\"viosname\" =~ /^$ViosName$/) AND $timeFilter GROUP BY \"viosname\" fill(previous)", "queryType": "randomWalk", "rawQuery": true, "refId": "A", @@ -1395,8 +1390,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" } ] }, @@ -1569,8 +1563,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", diff --git a/doc/dashboards/HMCi - Power VIO Utilization.json b/doc/dashboards/HMCi - Power VIO Utilization.json index 888cb7a..1bdedfa 100644 --- a/doc/dashboards/HMCi - Power VIO Utilization.json +++ b/doc/dashboards/HMCi - Power VIO Utilization.json @@ -1,7 +1,7 @@ { "__inputs": [ { - "name": "DS_INFLUXDB", + "name": "DS_HMCI", "label": "Database", "description": "", "type": "datasource", @@ -21,7 +21,7 @@ "type": "grafana", "id": "grafana", "name": "Grafana", - "version": "9.1.3" + "version": "9.1.6" }, { "type": "datasource", @@ -77,7 +77,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "gridPos": { "h": 3, @@ -90,12 +90,12 @@ "content": "## Metrics collected from IBM Power HMC\n \nFor more information visit: [git.data.coop/nellemann/hmci](https://git.data.coop/nellemann/hmci)\n ", "mode": "markdown" }, - "pluginVersion": "9.1.3", + "pluginVersion": "9.1.6", "targets": [ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "refId": "A" } @@ -106,7 +106,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -155,13 +155,13 @@ "showThresholdLabels": false, "showThresholdMarkers": false }, - "pluginVersion": "9.1.3", + "pluginVersion": "9.1.6", "targets": [ { "alias": "$tag_servername - $tag_viosname", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ @@ -194,7 +194,7 @@ "measurement": "vios_processor", "orderByTime": "ASC", "policy": "default", - "query": "SELECT last(\"utilizedProcUnits\") / last(\"maxProcUnits\") AS \"utilization\" FROM \"vios_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"viosname\" =~ /^$ViosName$/) AND $timeFilter GROUP BY time($interval), \"viosname\", \"servername\" fill(none)", + "query": "SELECT mean(\"utilizedProcUnits\") / mean(\"entitledProcUnits\") AS \"utilization\" FROM \"vios_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"viosname\" =~ /^$ViosName$/) AND $timeFilter GROUP BY time($interval), \"viosname\", \"servername\" fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -257,7 +257,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -344,7 +344,7 @@ "alias": "$tag_servername - $tag_viosname", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ @@ -377,7 +377,7 @@ "measurement": "vios_processor", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"utilizedProcUnits\") / mean(\"maxProcUnits\") AS \"utilization\" FROM \"vios_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"viosname\" =~ /^$ViosName$/) AND $timeFilter GROUP BY time($interval), \"viosname\", \"servername\" fill(none)", + "query": "SELECT mean(\"utilizedProcUnits\") / mean(\"entitledProcUnits\") AS \"utilization\" FROM \"vios_processor\" WHERE (\"servername\" =~ /^$ServerName$/ AND \"viosname\" =~ /^$ViosName$/) AND $timeFilter GROUP BY time($interval), \"viosname\", \"servername\" fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -440,7 +440,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -527,7 +527,7 @@ "alias": "$tag_servername - $tag_viosname ($tag_location - $col)", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ @@ -645,7 +645,7 @@ { "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "description": "", "fieldConfig": { @@ -727,7 +727,7 @@ "alias": "$tag_servername - $tag_viosname ($tag_location - $col)", "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "dsType": "influxdb", "groupBy": [ @@ -860,7 +860,7 @@ "current": {}, "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "definition": "SHOW TAG VALUES FROM \"server_processor\" WITH KEY = \"servername\" WHERE time > now() - 24h", "hide": 0, @@ -884,7 +884,7 @@ "current": {}, "datasource": { "type": "influxdb", - "uid": "${DS_INFLUXDB}" + "uid": "${DS_HMCI}" }, "definition": "SHOW TAG VALUES FROM \"vios_details\" WITH KEY = \"viosname\" WHERE servername =~ /$ServerName/ AND time > now() - 24h", "hide": 0, @@ -906,7 +906,7 @@ ] }, "time": { - "from": "now-2d", + "from": "now-7d", "now": false, "to": "now-30s" }, @@ -937,6 +937,6 @@ "timezone": "browser", "title": "HMCi - Power VIO Utilization", "uid": "DDNEv5vGy", - "version": 10, + "version": 2, "weekStart": "" } diff --git a/gradle.properties b/gradle.properties index a0a5155..a7b2fcb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ projectId = hmci projectGroup = biz.nellemann.hmci -projectVersion = 1.4.2 +projectVersion = 1.4.3 diff --git a/src/main/java/biz/nellemann/hmci/InfluxClient.java b/src/main/java/biz/nellemann/hmci/InfluxClient.java index fb0f9ee..21e5afc 100644 --- a/src/main/java/biz/nellemann/hmci/InfluxClient.java +++ b/src/main/java/biz/nellemann/hmci/InfluxClient.java @@ -23,7 +23,6 @@ import org.influxdb.dto.Point; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; @@ -98,13 +97,6 @@ public final class InfluxClient { } - /* - public void write(List measurements, Instant timestamp, String name) { - log.debug("write() - measurement: {} {}", name, measurements.size()); - processMeasurementMap(measurements, timestamp, name).forEach( (point) -> { influxDB.write(point); }); - }*/ - - public void write(List measurements, String name) { log.debug("write() - measurement: {} {}", name, measurements.size()); if(!measurements.isEmpty()) { @@ -115,23 +107,6 @@ public final class InfluxClient { } - /* - private List processMeasurementMap(List measurements, Instant timestamp, String name) { - List listOfPoints = new ArrayList<>(); - measurements.forEach( (m) -> { - - Point.Builder builder = Point.measurement(name) - .time(timestamp.getEpochSecond(), TimeUnit.SECONDS) - .tag(m.tags) - .fields(m.fields); - - listOfPoints.add(builder.build()); - }); - - return listOfPoints; - }*/ - - private List processMeasurementMap(List measurements, String name) { List listOfPoints = new ArrayList<>(); measurements.forEach( (m) -> { diff --git a/src/main/java/biz/nellemann/hmci/ManagementConsole.java b/src/main/java/biz/nellemann/hmci/ManagementConsole.java index af6163f..c0fe494 100644 --- a/src/main/java/biz/nellemann/hmci/ManagementConsole.java +++ b/src/main/java/biz/nellemann/hmci/ManagementConsole.java @@ -23,7 +23,6 @@ import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; import java.time.Duration; import java.time.Instant; import java.time.temporal.ChronoUnit; diff --git a/src/main/java/biz/nellemann/hmci/Resource.java b/src/main/java/biz/nellemann/hmci/Resource.java index 33c4d03..c8da817 100644 --- a/src/main/java/biz/nellemann/hmci/Resource.java +++ b/src/main/java/biz/nellemann/hmci/Resource.java @@ -21,9 +21,9 @@ public abstract class Resource { private final ArrayList sampleHistory = new ArrayList<>(); protected SystemUtil metric; - protected final int maxNumberOfSamples = 60; - protected final int minNumberOfSamples = 5; - protected int noOfSamples = maxNumberOfSamples; + protected final int MAX_NUMBER_OF_SAMPLES = 60; + protected final int MIN_NUMBER_OF_SAMPLES = 5; + protected int noOfSamples = MAX_NUMBER_OF_SAMPLES; @@ -125,8 +125,8 @@ public abstract class Resource { } // Decrease down to minSamples - if(noOfSamples > minNumberOfSamples) { - noOfSamples = Math.min( (noOfSamples - 1), Math.max( (noOfSamples - processed) + 5, minNumberOfSamples)); + if(noOfSamples > MIN_NUMBER_OF_SAMPLES) { + noOfSamples = Math.min( (noOfSamples - 1), Math.max( (noOfSamples - processed) + 5, MIN_NUMBER_OF_SAMPLES)); } } diff --git a/src/main/java/biz/nellemann/hmci/RestClient.java b/src/main/java/biz/nellemann/hmci/RestClient.java index 0230f0d..3a3567b 100644 --- a/src/main/java/biz/nellemann/hmci/RestClient.java +++ b/src/main/java/biz/nellemann/hmci/RestClient.java @@ -131,9 +131,7 @@ public class RestClient { .delete() .build(); - String responseBody; try (Response response = httpClient.newCall(request).execute()) { - responseBody = Objects.requireNonNull(response.body()).string(); } catch (IOException e) { log.warn("logoff() error: {}", e.getMessage()); } finally { diff --git a/src/main/java/biz/nellemann/hmci/dto/json/SystemFirmware.java b/src/main/java/biz/nellemann/hmci/dto/json/SystemFirmware.java index 98305ed..0cb1b6b 100644 --- a/src/main/java/biz/nellemann/hmci/dto/json/SystemFirmware.java +++ b/src/main/java/biz/nellemann/hmci/dto/json/SystemFirmware.java @@ -2,7 +2,6 @@ package biz.nellemann.hmci.dto.json; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonUnwrapped; @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/biz/nellemann/hmci/dto/xml/XmlEntry.java b/src/main/java/biz/nellemann/hmci/dto/xml/XmlEntry.java index eaaa74d..98cfe20 100644 --- a/src/main/java/biz/nellemann/hmci/dto/xml/XmlEntry.java +++ b/src/main/java/biz/nellemann/hmci/dto/xml/XmlEntry.java @@ -5,7 +5,6 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; -import java.util.List; //@JsonIgnoreProperties({ "author", "etag" }) @JsonIgnoreProperties(ignoreUnknown = true) diff --git a/src/main/java/biz/nellemann/hmci/dto/xml/XmlFeed.java b/src/main/java/biz/nellemann/hmci/dto/xml/XmlFeed.java index 258baec..b6093ec 100644 --- a/src/main/java/biz/nellemann/hmci/dto/xml/XmlFeed.java +++ b/src/main/java/biz/nellemann/hmci/dto/xml/XmlFeed.java @@ -6,9 +6,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import java.io.Serializable; -import java.util.ArrayList; import java.util.List; -import java.util.Set; //@JsonIgnoreProperties({ "link" }) @JsonIgnoreProperties(ignoreUnknown = true)