2020-10-12 08:15:53 +00:00
|
|
|
/*
|
2020-10-11 10:25:55 +00:00
|
|
|
* Copyright 2020 Mark Nellemann <mark.nellemann@gmail.com>
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
package biz.nellemann.hmci;
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
import biz.nellemann.hmci.dto.xml.*;
|
|
|
|
import com.fasterxml.jackson.core.JsonParseException;
|
2022-11-28 08:12:33 +00:00
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
2022-11-26 09:47:10 +00:00
|
|
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
2022-11-24 11:35:49 +00:00
|
|
|
import com.fasterxml.jackson.dataformat.xml.XmlMapper;
|
2020-10-11 10:25:55 +00:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.net.URI;
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
import java.util.*;
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
class ManagedSystem extends Resource {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
private final static Logger log = LoggerFactory.getLogger(ManagedSystem.class);
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
protected final List<LogicalPartition> logicalPartitions = new ArrayList<>();
|
|
|
|
protected final List<VirtualIOServer> virtualIOServers = new ArrayList<>();
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
private List<String> excludePartitions = new ArrayList<>();
|
|
|
|
private List<String> includePartitions = new ArrayList<>();
|
2020-12-11 07:39:19 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
private final RestClient restClient;
|
|
|
|
|
|
|
|
protected ManagedSystemEntry entry;
|
|
|
|
|
2022-11-26 09:47:10 +00:00
|
|
|
protected ManagedSystemPcmPreference pcmPreference;
|
2022-11-24 11:35:49 +00:00
|
|
|
protected SystemEnergy systemEnergy;
|
|
|
|
|
2022-11-28 08:12:33 +00:00
|
|
|
protected boolean enableEnergyMonitoring = false;
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
private String uriPath;
|
|
|
|
public String name;
|
|
|
|
public String id;
|
|
|
|
|
|
|
|
|
|
|
|
public ManagedSystem(RestClient restClient, String href) {
|
|
|
|
log.debug("ManagedSystem() - {}", href);
|
|
|
|
this.restClient = restClient;
|
|
|
|
try {
|
|
|
|
URI uri = new URI(href);
|
|
|
|
uriPath = uri.getPath();
|
|
|
|
} catch (URISyntaxException e) {
|
|
|
|
log.error("ManagedSystem() - {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
|
2021-01-13 07:31:07 +00:00
|
|
|
@Override
|
2020-10-11 10:25:55 +00:00
|
|
|
public String toString() {
|
2022-11-24 11:35:49 +00:00
|
|
|
//return String.format("[%s] %s (%s-%s %s)", id, name, type, model, serialNumber);
|
|
|
|
return "TODO";
|
2020-10-11 10:25:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
public void setExcludePartitions(List<String> excludePartitions) {
|
|
|
|
this.excludePartitions = excludePartitions;
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
public void setIncludePartitions(List<String> includePartitions) {
|
|
|
|
this.includePartitions = includePartitions;
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
public void setDoEnergy(Boolean doEnergy) {
|
2022-11-26 09:47:10 +00:00
|
|
|
|
|
|
|
if(pcmPreference == null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-11-28 08:12:33 +00:00
|
|
|
if(doEnergy && pcmPreference.energyMonitoringCapable && !pcmPreference.energyMonitorEnabled) {
|
|
|
|
setPcmPreference();
|
2022-11-26 09:47:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(pcmPreference.energyMonitorEnabled) {
|
|
|
|
systemEnergy = new SystemEnergy(restClient, this);
|
|
|
|
}
|
|
|
|
|
2021-03-25 15:46:04 +00:00
|
|
|
}
|
|
|
|
|
2022-11-28 08:12:33 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
public void discover() {
|
|
|
|
|
|
|
|
try {
|
|
|
|
String xml = restClient.getRequest(uriPath);
|
|
|
|
|
|
|
|
// Do not try to parse empty response
|
|
|
|
if(xml == null || xml.length() <= 1) {
|
|
|
|
log.warn("discover() - no data.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
XmlMapper xmlMapper = new XmlMapper();
|
|
|
|
XmlEntry xmlEntry = xmlMapper.readValue(xml, XmlEntry.class);
|
|
|
|
|
|
|
|
if(xmlEntry.getContent() == null){
|
|
|
|
log.warn("discover() - no content.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.id = xmlEntry.id;
|
|
|
|
if(xmlEntry.getContent().isManagedSystem()) {
|
|
|
|
entry = xmlEntry.getContent().getManagedSystemEntry();
|
|
|
|
this.name = entry.getName();
|
|
|
|
} else {
|
|
|
|
throw new UnsupportedOperationException("Failed to deserialize ManagedSystem");
|
|
|
|
}
|
|
|
|
|
|
|
|
logicalPartitions.clear();
|
|
|
|
for (Link link : this.entry.getAssociatedLogicalPartitions()) {
|
|
|
|
LogicalPartition logicalPartition = new LogicalPartition(restClient, link.getHref(), this);
|
|
|
|
logicalPartition.discover();
|
|
|
|
|
|
|
|
// Check exclude / include
|
|
|
|
if(!excludePartitions.contains(logicalPartition.name) && includePartitions.isEmpty()) {
|
|
|
|
logicalPartitions.add(logicalPartition);
|
|
|
|
//log.info("discover() - adding !excluded partition: {}", logicalPartition.name);
|
|
|
|
} else if(!includePartitions.isEmpty() && includePartitions.contains(logicalPartition.name)) {
|
|
|
|
logicalPartitions.add(logicalPartition);
|
|
|
|
//log.info("discover() - adding included partition: {}", logicalPartition.name);
|
|
|
|
}
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
virtualIOServers.clear();
|
|
|
|
for (Link link : this.entry.getAssociatedVirtualIOServers()) {
|
|
|
|
VirtualIOServer virtualIOServer = new VirtualIOServer(restClient, link.getHref(), this);
|
|
|
|
virtualIOServer.discover();
|
|
|
|
virtualIOServers.add(virtualIOServer);
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("discover() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
public void refresh() {
|
|
|
|
|
|
|
|
log.debug("refresh()");
|
|
|
|
try {
|
|
|
|
String xml = restClient.getRequest(String.format("/rest/api/pcm/ManagedSystem/%s/ProcessedMetrics?NoOfSamples=1", id));
|
|
|
|
|
|
|
|
// Do not try to parse empty response
|
|
|
|
if(xml == null || xml.length() <= 1) {
|
|
|
|
log.warn("refresh() - no data.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
XmlMapper xmlMapper = new XmlMapper();
|
|
|
|
XmlFeed xmlFeed = xmlMapper.readValue(xml, XmlFeed.class);
|
|
|
|
|
|
|
|
xmlFeed.entries.forEach((entry) -> {
|
|
|
|
if (entry.category.term.equals("ManagedSystem")) {
|
|
|
|
Link link = entry.link;
|
|
|
|
if (link.getType() != null && Objects.equals(link.getType(), "application/json")) {
|
|
|
|
try {
|
|
|
|
URI jsonUri = URI.create(link.getHref());
|
|
|
|
String json = restClient.getRequest(jsonUri.getPath());
|
|
|
|
deserialize(json);
|
|
|
|
} catch (IOException e) {
|
|
|
|
log.error("refresh() - error 1: {}", e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
} catch (JsonParseException e) {
|
|
|
|
log.warn("refresh() - parse error for: {}", name);
|
|
|
|
metric = null;
|
|
|
|
} catch (IOException e) {
|
|
|
|
log.error("refresh() - error 2: {} {}", e.getClass(), e.getMessage());
|
|
|
|
metric = null;
|
|
|
|
}
|
|
|
|
|
2020-10-11 10:25:55 +00:00
|
|
|
}
|
|
|
|
|
2022-11-28 08:12:33 +00:00
|
|
|
public void setPcmPreference() {
|
|
|
|
log.info("getPcmPreferences()");
|
|
|
|
|
|
|
|
try {
|
|
|
|
String urlPath = String.format("/rest/api/pcm/ManagedSystem/%s/preferences", id);
|
|
|
|
XmlMapper xmlMapper = new XmlMapper();
|
|
|
|
|
|
|
|
if(pcmPreference.energyMonitoringCapable && !pcmPreference.energyMonitorEnabled) {
|
|
|
|
//log.warn("getPcmPreferences() - TODO: Enabling energyMonitor");
|
|
|
|
pcmPreference.metadata.atom = null;
|
|
|
|
pcmPreference.energyMonitorEnabled = true;
|
|
|
|
//xmlMapper.enable(SerializationFeature.INDENT_OUTPUT);
|
|
|
|
String updateXml = xmlMapper.writeValueAsString(pcmPreference);
|
|
|
|
//log.warn(updateXml);
|
|
|
|
restClient.postRequest(urlPath, updateXml);
|
|
|
|
}
|
|
|
|
} catch (IOException e) {
|
|
|
|
log.warn("setPcmPreferences() - Error: {}", e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-26 09:47:10 +00:00
|
|
|
public void getPcmPreferences() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-28 08:12:33 +00:00
|
|
|
log.debug("getPcmPreferences()");
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
2022-11-26 09:47:10 +00:00
|
|
|
String urlPath = String.format("/rest/api/pcm/ManagedSystem/%s/preferences", id);
|
|
|
|
String xml = restClient.getRequest(urlPath);
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// Do not try to parse empty response
|
2022-11-26 09:47:10 +00:00
|
|
|
if(xml == null || xml.length() <= 1) {
|
|
|
|
log.warn("getPcmPreferences() - no data.");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
XmlMapper xmlMapper = new XmlMapper();
|
|
|
|
XmlFeed xmlFeed = xmlMapper.readValue(xml, XmlFeed.class);
|
|
|
|
|
|
|
|
if(xmlFeed.getEntry().getContent() == null){
|
|
|
|
log.warn("getPcmPreferences() - no content.");
|
|
|
|
log.info(xml);
|
2022-11-24 11:35:49 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-11-26 09:47:10 +00:00
|
|
|
if(xmlFeed.getEntry().getContent().isManagedSystemPcmPreference()) {
|
|
|
|
pcmPreference = xmlFeed.getEntry().getContent().getManagedSystemPcmPreference();
|
2022-11-28 08:12:33 +00:00
|
|
|
enableEnergyMonitoring = pcmPreference.energyMonitorEnabled;
|
2022-11-24 11:35:49 +00:00
|
|
|
} else {
|
2022-11-26 09:47:10 +00:00
|
|
|
throw new UnsupportedOperationException("Failed to deserialize ManagedSystemPcmPreference");
|
2022-11-24 11:35:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
2022-11-28 08:12:33 +00:00
|
|
|
log.warn("getPcmPreferences() - Error: {}", e.getMessage());
|
2022-11-24 11:35:49 +00:00
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// System details
|
|
|
|
List<Measurement> getDetails() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
List<Measurement> list = new ArrayList<>();
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
Map<String, String> tagsMap = new TreeMap<>();
|
|
|
|
Map<String, Object> fieldsMap = new TreeMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
log.trace("getDetails() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("mtm", String.format("%s-%s %s",
|
|
|
|
entry.getMachineTypeModelAndSerialNumber().getMachineType(),
|
|
|
|
entry.getMachineTypeModelAndSerialNumber().getModel(),
|
|
|
|
entry.getMachineTypeModelAndSerialNumber().getSerialNumber())
|
|
|
|
);
|
|
|
|
fieldsMap.put("APIversion", metric.getUtilInfo().version);
|
|
|
|
fieldsMap.put("metric", metric.utilInfo.metricType);
|
|
|
|
fieldsMap.put("frequency", metric.getUtilInfo().frequency);
|
|
|
|
fieldsMap.put("nextract", "HMCi");
|
|
|
|
fieldsMap.put("name", entry.getName());
|
|
|
|
fieldsMap.put("utilizedProcUnits", metric.getSample().systemFirmwareUtil.utilizedProcUnits);
|
|
|
|
fieldsMap.put("assignedMem", metric.getSample().systemFirmwareUtil.assignedMem);
|
|
|
|
log.trace("getDetails() - fields: " + fieldsMap);
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2020-12-11 07:39:19 +00:00
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getDetails() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2020-12-16 11:36:08 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// System Memory
|
|
|
|
List<Measurement> getMemoryMetrics() {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
Map<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
log.trace("getMemoryMetrics() - tags: " + tagsMap);
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
fieldsMap.put("totalMem", metric.getSample().serverUtil.memory.totalMem);
|
|
|
|
fieldsMap.put("availableMem", metric.getSample().serverUtil.memory.availableMem);
|
|
|
|
fieldsMap.put("configurableMem", metric.getSample().serverUtil.memory.configurableMem);
|
|
|
|
fieldsMap.put("assignedMemToLpars", metric.getSample().serverUtil.memory.assignedMemToLpars);
|
|
|
|
fieldsMap.put("virtualPersistentMem", metric.getSample().serverUtil.memory.virtualPersistentMem);
|
|
|
|
log.trace("getMemoryMetrics() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getMemoryMetrics() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// System Processor
|
|
|
|
List<Measurement> getProcessorMetrics() {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
log.trace("getProcessorMetrics() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("totalProcUnits", metric.getSample().serverUtil.processor.totalProcUnits);
|
|
|
|
fieldsMap.put("utilizedProcUnits", metric.getSample().serverUtil.processor.utilizedProcUnits);
|
|
|
|
fieldsMap.put("availableProcUnits", metric.getSample().serverUtil.processor.availableProcUnits);
|
|
|
|
fieldsMap.put("configurableProcUnits", metric.getSample().serverUtil.processor.configurableProcUnits);
|
|
|
|
log.trace("getProcessorMetrics() - fields: " + fieldsMap);
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getProcessorMetrics() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// Sytem Shared ProcessorPools
|
|
|
|
List<Measurement> getSharedProcessorPools() {
|
2020-12-16 11:36:08 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
2020-12-16 11:36:08 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
metric.getSample().serverUtil.sharedProcessorPool.forEach(sharedProcessorPool -> {
|
2021-01-13 07:31:07 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("pool", String.valueOf(sharedProcessorPool.id));
|
|
|
|
tagsMap.put("poolname", sharedProcessorPool.name);
|
|
|
|
log.trace("getSharedProcessorPools() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("assignedProcUnits", sharedProcessorPool.assignedProcUnits);
|
|
|
|
fieldsMap.put("availableProcUnits", sharedProcessorPool.availableProcUnits);
|
|
|
|
fieldsMap.put("utilizedProcUnits", sharedProcessorPool.utilizedProcUnits);
|
|
|
|
fieldsMap.put("borrowedProcUnits", sharedProcessorPool.borrowedProcUnits);
|
|
|
|
fieldsMap.put("configuredProcUnits", sharedProcessorPool.configuredProcUnits);
|
|
|
|
log.trace("getSharedProcessorPools() - fields: " + fieldsMap);
|
2020-12-16 11:36:08 +00:00
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getSharedProcessorPools() - error: {}", e.getMessage());
|
|
|
|
|
|
|
|
}
|
2020-12-16 11:36:08 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// System Physical ProcessorPool
|
|
|
|
List<Measurement> getPhysicalProcessorPool() {
|
2020-12-16 11:36:08 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
2021-01-13 07:31:07 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
log.trace("getPhysicalProcessorPool() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("assignedProcUnits", metric.getSample().serverUtil.physicalProcessorPool.assignedProcUnits);
|
|
|
|
fieldsMap.put("availableProcUnits", metric.getSample().serverUtil.physicalProcessorPool.availableProcUnits);
|
|
|
|
fieldsMap.put("utilizedProcUnits", metric.getSample().serverUtil.physicalProcessorPool.utilizedProcUnits);
|
|
|
|
fieldsMap.put("configuredProcUnits", metric.getSample().serverUtil.physicalProcessorPool.configuredProcUnits);
|
|
|
|
fieldsMap.put("borrowedProcUnits", metric.getSample().serverUtil.physicalProcessorPool.borrowedProcUnits);
|
|
|
|
log.trace("getPhysicalProcessorPool() - fields: " + fieldsMap);
|
2020-12-16 11:36:08 +00:00
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getPhysicalProcessorPool() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-12-16 11:36:08 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
/**
|
|
|
|
* VIO Aggregated Metrics are stored under the Managed System
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
// VIO Details
|
|
|
|
List<Measurement> getVioDetails() {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach(vio -> {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
log.trace("getVioDetails() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("viosid", vio.id);
|
|
|
|
fieldsMap.put("viosstate", vio.state);
|
|
|
|
fieldsMap.put("viosname", vio.name);
|
|
|
|
fieldsMap.put("affinityScore", vio.affinityScore);
|
|
|
|
log.trace("getVioDetails() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioDetails() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIO Memory
|
|
|
|
List<Measurement> getVioMemoryMetrics() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach(vio -> {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2021-01-13 07:31:07 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
log.trace("getVioMemoryMetrics() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
Number assignedMem = vio.memory.assignedMem;
|
|
|
|
Number utilizedMem = vio.memory.utilizedMem;
|
|
|
|
Number usedMemPct = (utilizedMem.intValue() * 100 ) / assignedMem.intValue();
|
|
|
|
fieldsMap.put("assignedMem", vio.memory.assignedMem);
|
|
|
|
fieldsMap.put("utilizedMem", vio.memory.utilizedMem);
|
|
|
|
fieldsMap.put("utilizedPct", usedMemPct.floatValue());
|
|
|
|
log.trace("getVioMemoryMetrics() - fields: " + fieldsMap);
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2020-12-11 07:39:19 +00:00
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
2020-10-11 10:25:55 +00:00
|
|
|
});
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioMemoryMetrics() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIO Processor
|
|
|
|
List<Measurement> getVioProcessorMetrics() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach(vio -> {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
log.trace("getVioProcessorMetrics() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("utilizedProcUnits", vio.processor.utilizedProcUnits);
|
|
|
|
fieldsMap.put("utilizedCappedProcUnits", vio.processor.utilizedCappedProcUnits);
|
|
|
|
fieldsMap.put("utilizedUncappedProcUnits", vio.processor.utilizedUncappedProcUnits);
|
|
|
|
fieldsMap.put("currentVirtualProcessors", vio.processor.currentVirtualProcessors);
|
|
|
|
fieldsMap.put("maxVirtualProcessors", vio.processor.maxVirtualProcessors);
|
|
|
|
fieldsMap.put("maxProcUnits", vio.processor.maxProcUnits);
|
|
|
|
fieldsMap.put("entitledProcUnits", vio.processor.entitledProcUnits);
|
|
|
|
fieldsMap.put("donatedProcUnits", vio.processor.donatedProcUnits);
|
|
|
|
fieldsMap.put("idleProcUnits", vio.processor.idleProcUnits);
|
|
|
|
fieldsMap.put("timeSpentWaitingForDispatch", vio.processor.timePerInstructionExecution);
|
|
|
|
fieldsMap.put("timePerInstructionExecution", vio.processor.timeSpentWaitingForDispatch);
|
|
|
|
fieldsMap.put("weight", vio.processor.weight);
|
|
|
|
fieldsMap.put("mode", vio.processor.mode);
|
|
|
|
log.trace("getVioProcessorMetrics() - fields: " + fieldsMap);
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioProcessorMetrics() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIOs - Network
|
|
|
|
List<Measurement> getVioNetworkLpars() {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach(vio -> {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2021-01-13 07:31:07 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
log.trace("getVioNetworkLpars() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("clientlpars", vio.network.clientLpars.size());
|
|
|
|
log.trace("getVioNetworkLpars() - fields: " + fieldsMap);
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2020-12-11 07:39:19 +00:00
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
2020-10-11 10:25:55 +00:00
|
|
|
});
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioNetworkLpars() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
// VIO Network - Shared
|
|
|
|
List<Measurement> getVioNetworkSharedAdapters() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2021-03-25 15:46:04 +00:00
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach(vio -> {
|
|
|
|
vio.network.sharedAdapters.forEach(adapter -> {
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
//tagsMap.put("id", adapter.id);
|
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
log.trace("getVioNetworkSharedAdapters() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("id", adapter.id);
|
|
|
|
fieldsMap.put("type", adapter.type);
|
|
|
|
fieldsMap.put("sentBytes", adapter.sentBytes);
|
|
|
|
fieldsMap.put("sentPackets", adapter.sentPackets);
|
|
|
|
fieldsMap.put("receivedBytes", adapter.receivedBytes);
|
|
|
|
fieldsMap.put("receivedPackets", adapter.receivedPackets);
|
|
|
|
fieldsMap.put("droppedPackets", adapter.droppedPackets);
|
|
|
|
fieldsMap.put("transferredBytes", adapter.transferredBytes);
|
|
|
|
log.trace("getVioNetworkSharedAdapters() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioNetworkSharedAdapters() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
return list;
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIO Network - Virtual
|
|
|
|
List<Measurement> getVioNetworkVirtualAdapters() {
|
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
|
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach( vio -> {
|
|
|
|
vio.network.virtualEthernetAdapters.forEach( adapter -> {
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("vlanid", String.valueOf(adapter.vlanId));
|
|
|
|
tagsMap.put("vswitchid", String.valueOf(adapter.vswitchId));
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
log.trace("getVioNetworkVirtualAdapters() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("droppedPackets", adapter.droppedPackets);
|
|
|
|
fieldsMap.put("droppedPhysicalPackets", adapter.droppedPhysicalPackets);
|
|
|
|
fieldsMap.put("isPortVlanId", adapter.isPortVlanId);
|
|
|
|
fieldsMap.put("receivedBytes", adapter.receivedBytes);
|
|
|
|
fieldsMap.put("receivedPackets", adapter.receivedPackets);
|
|
|
|
fieldsMap.put("receivedPhysicalBytes", adapter.receivedPhysicalBytes);
|
|
|
|
fieldsMap.put("receivedPhysicalPackets", adapter.receivedPhysicalPackets);
|
|
|
|
fieldsMap.put("sentBytes", adapter.sentBytes);
|
|
|
|
fieldsMap.put("sentPackets", adapter.sentPackets);
|
|
|
|
fieldsMap.put("sentPhysicalBytes", adapter.sentPhysicalBytes);
|
|
|
|
fieldsMap.put("sentPhysicalPackets", adapter.sentPhysicalPackets);
|
|
|
|
fieldsMap.put("transferredBytes", adapter.transferredBytes);
|
|
|
|
fieldsMap.put("transferredPhysicalBytes", adapter.transferredPhysicalBytes);
|
|
|
|
log.trace("getVioNetworkVirtualAdapters() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioNetworkVirtualAdapters() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
// VIO Network - Generic
|
|
|
|
List<Measurement> getVioNetworkGenericAdapters() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach( vio -> {
|
|
|
|
vio.network.genericAdapters.forEach( adapter -> {
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("id", adapter.id);
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
log.trace("getVioNetworkGenericAdapters() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("sentBytes", adapter.sentBytes);
|
|
|
|
fieldsMap.put("sentPackets", adapter.sentPackets);
|
|
|
|
fieldsMap.put("receivedBytes", adapter.receivedBytes);
|
|
|
|
fieldsMap.put("receivedPackets", adapter.receivedPackets);
|
|
|
|
fieldsMap.put("droppedPackets", adapter.droppedPackets);
|
|
|
|
fieldsMap.put("transferredBytes", adapter.transferredBytes);
|
|
|
|
log.trace("getVioNetworkGenericAdapters() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioNetworkGenericAdapters() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
return list;
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIOs - Storage
|
|
|
|
List<Measurement> getVioStorageLpars() {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach(vio -> {
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
log.trace("getVioStorageLpars() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("clientlpars", vio.storage.clientLpars.size());
|
|
|
|
log.trace("getVioStorageLpars() - fields: " + fieldsMap);
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioStorageLpars() - error: {}", e.getMessage());
|
|
|
|
}
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIO Storage FC
|
|
|
|
List<Measurement> getVioStorageFiberChannelAdapters() {
|
2021-03-25 15:46:04 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach( vio -> {
|
|
|
|
log.trace("getVioStorageFiberChannelAdapters() - VIO: " + vio.name);
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
vio.storage.fiberChannelAdapters.forEach( adapter -> {
|
2020-10-15 13:23:16 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
tagsMap.put("id", adapter.id);
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
log.trace("getVioStorageFiberChannelAdapters() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("numOfReads", adapter.numOfReads);
|
|
|
|
fieldsMap.put("numOfWrites", adapter.numOfWrites);
|
|
|
|
fieldsMap.put("readBytes", adapter.readBytes);
|
|
|
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
|
|
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
|
|
|
log.trace("getVioStorageFiberChannelAdapters() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioStorageFiberChannelAdapters() - error: {}", e.getMessage());
|
|
|
|
}
|
|
|
|
|
2020-10-11 10:25:55 +00:00
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
|
2021-03-25 15:46:04 +00:00
|
|
|
// VIO Storage - Physical
|
2022-11-24 11:35:49 +00:00
|
|
|
List<Measurement> getVioStoragePhysicalAdapters() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
List<Measurement> list = new ArrayList<>();
|
2022-11-24 11:35:49 +00:00
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach( vio -> {
|
|
|
|
log.trace("getVioStoragePhysicalAdapters() - VIO: " + vio.name);
|
|
|
|
|
|
|
|
vio.storage.genericPhysicalAdapters.forEach( adapter -> {
|
|
|
|
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
tagsMap.put("id", adapter.id);
|
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
log.trace("getVioStoragePhysicalAdapters() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("numOfReads", adapter.numOfReads);
|
|
|
|
fieldsMap.put("numOfWrites", adapter.numOfWrites);
|
|
|
|
fieldsMap.put("readBytes", adapter.readBytes);
|
|
|
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
|
|
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
|
|
|
fieldsMap.put("type", adapter.type);
|
|
|
|
log.trace("getVioStoragePhysicalAdapters() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioStoragePhysicalAdapters() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
return list;
|
|
|
|
}
|
2020-10-11 10:25:55 +00:00
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
// VIO Storage - Virtual
|
|
|
|
List<Measurement> getVioStorageVirtualAdapters() {
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
List<Measurement> list = new ArrayList<>();
|
|
|
|
try {
|
|
|
|
metric.getSample().viosUtil.forEach( (vio) -> {
|
|
|
|
vio.storage.genericVirtualAdapters.forEach( (adapter) -> {
|
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
|
|
|
|
tagsMap.put("servername", entry.getName());
|
|
|
|
tagsMap.put("viosname", vio.name);
|
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
tagsMap.put("id", adapter.id);
|
|
|
|
log.debug("getVioStorageVirtualAdapters() - tags: " + tagsMap);
|
|
|
|
|
|
|
|
fieldsMap.put("numOfReads", adapter.numOfReads);
|
|
|
|
fieldsMap.put("numOfWrites", adapter.numOfWrites);
|
|
|
|
fieldsMap.put("readBytes", adapter.readBytes);
|
|
|
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
|
|
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
|
|
|
fieldsMap.put("type", adapter.type);
|
|
|
|
log.debug("getVioStorageVirtualAdapters() - fields: " + fieldsMap);
|
|
|
|
|
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
|
|
|
});
|
2020-12-11 07:39:19 +00:00
|
|
|
});
|
2022-11-24 11:35:49 +00:00
|
|
|
} catch (Exception e) {
|
|
|
|
log.warn("getVioStorageVirtualAdapters() - error: {}", e.getMessage());
|
|
|
|
}
|
2020-12-11 07:39:19 +00:00
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
/*
|
|
|
|
// VIO Storage SSP TODO
|
|
|
|
List<Measurement> getViosStorageSharedStoragePools() {
|
2020-12-11 07:39:19 +00:00
|
|
|
|
2021-03-25 15:46:04 +00:00
|
|
|
List<Measurement> list = new ArrayList<>();
|
2020-12-11 07:39:19 +00:00
|
|
|
metrics.systemUtil.sample.viosUtil.forEach( vios -> {
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
vios.storage.fiberChannelAdapters.forEach( adapter -> {
|
2020-12-11 07:39:19 +00:00
|
|
|
|
2021-01-13 07:31:07 +00:00
|
|
|
HashMap<String, String> tagsMap = new HashMap<>();
|
2021-03-25 15:46:04 +00:00
|
|
|
tagsMap.put("servername", name);
|
|
|
|
tagsMap.put("viosname", vios.name);
|
|
|
|
tagsMap.put("id", adapter.id);
|
2022-11-24 11:35:49 +00:00
|
|
|
tagsMap.put("location", adapter.physicalLocation);
|
|
|
|
log.trace("getViosStorageSharedStoragePools() - tags: " + tagsMap.toString());
|
2020-12-11 07:39:19 +00:00
|
|
|
|
2021-03-25 15:46:04 +00:00
|
|
|
HashMap<String, Object> fieldsMap = new HashMap<>();
|
|
|
|
fieldsMap.put("numOfReads", adapter.numOfReads);
|
|
|
|
fieldsMap.put("numOfWrites", adapter.numOfWrites);
|
|
|
|
fieldsMap.put("readBytes", adapter.readBytes);
|
|
|
|
fieldsMap.put("writeBytes", adapter.writeBytes);
|
|
|
|
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
|
2022-11-24 11:35:49 +00:00
|
|
|
fieldsMap.put("physicalLocation", adapter.physicalLocation);
|
|
|
|
log.trace("getViosStorageSharedStoragePools() - fields: " + fieldsMap.toString());
|
2020-10-11 10:25:55 +00:00
|
|
|
|
2020-12-11 07:39:19 +00:00
|
|
|
list.add(new Measurement(tagsMap, fieldsMap));
|
2020-10-11 10:25:55 +00:00
|
|
|
});
|
|
|
|
|
2022-11-24 11:35:49 +00:00
|
|
|
log.trace("getViosStorageSharedStoragePools() - VIOS: " + vios.name);
|
2020-10-11 10:25:55 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
return list;
|
|
|
|
}
|
2022-11-24 11:35:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-10-11 10:25:55 +00:00
|
|
|
}
|