Improve thread sleep logic, cleanup debug logging, and set better defaults for metrics.

This commit is contained in:
Mark Nellemann 2021-02-01 15:32:05 +01:00
parent 30f1f71a95
commit a9a130ff0f
24 changed files with 151 additions and 145 deletions

View File

@ -16,8 +16,8 @@ repositories {
}
dependencies {
annotationProcessor 'info.picocli:picocli-codegen:4.6.0'
implementation 'info.picocli:picocli:4.6.0'
annotationProcessor 'info.picocli:picocli-codegen:4.6.1'
implementation 'info.picocli:picocli:4.6.1'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.moshi:moshi:1.11.0'

View File

@ -1,3 +1,3 @@
id = hmci
group = biz.nellemann.hmci
version = 1.1.3
version = 1.1.4

View File

@ -32,13 +32,11 @@ import java.util.concurrent.Callable;
versionProvider = biz.nellemann.hmci.VersionProvider.class)
public class Application implements Callable<Integer> {
//private final static Logger log = LoggerFactory.getLogger(Application.class);
@Option(names = { "-c", "--conf" }, description = "Configuration file [default: '/etc/hmci.toml'].", defaultValue = "/etc/hmci.toml", paramLabel = "<file>")
private String configurationFile;
@Option(names = { "-d", "--debug" }, description = "Enable debugging [default: 'false'].")
private boolean enableDebug = false;
private boolean[] enableDebug = new boolean[0];
public static void main(String... args) {
int exitCode = new CommandLine(new Application()).execute(args);
@ -59,8 +57,15 @@ public class Application implements Callable<Integer> {
return -1;
}
if(enableDebug) {
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
switch (enableDebug.length) {
case 1:
System.out.println("DEBUG");
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
break;
case 2:
System.out.println("TRACE");
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE");
break;
}
try {
@ -70,8 +75,9 @@ public class Application implements Callable<Integer> {
for(Configuration.HmcObject configHmc : configuration.getHmc()) {
Thread t = new Thread(new HmcInstance(configHmc, influxClient));
threadList.add(t);
t.setName(configHmc.name);
t.start();
threadList.add(t);
}
for (Thread thread : threadList) {

View File

@ -16,7 +16,7 @@ public final class Configuration {
final private Long update;
final private Long rescan;
final private InfluxObject influx;
final private List<HmcObject> hmcList;
@ -114,17 +114,17 @@ public final class Configuration {
return c;
}
public List<HmcObject> getHmc() {
return hmcList;
return hmcList;
}
public InfluxObject getInflux() {
return influx;
}
static class InfluxObject {
String url = "http://localhost:8086";

View File

@ -89,16 +89,21 @@ class HmcInstance implements Runnable {
}
Instant instantEnd = Instant.now();
long timeSpend = Duration.between(instantStart, instantEnd).getSeconds();
log.debug("run() - duration sec: " + timeSpend);
if(timeSpend < updateValue) {
long timeSpend = Duration.between(instantStart, instantEnd).toMillis();
log.debug("run() - duration millis: " + timeSpend);
if(timeSpend < (updateValue * 1000)) {
try {
log.debug("run() - sleep sec: " + (updateValue - timeSpend));
//noinspection BusyWait
sleep((updateValue - timeSpend) * 1000);
long sleepTime = (updateValue * 1000) - timeSpend;
log.debug("run() - sleeping millis: " + sleepTime);
if(sleepTime > 0) {
//noinspection BusyWait
sleep(sleepTime);
}
} catch (InterruptedException e) {
log.error("run() - sleep interrupted", e);
}
} else {
log.warn("run() - slow response from HMC");
}
} while (keepRunning.get());
@ -108,7 +113,7 @@ class HmcInstance implements Runnable {
void discover() {
log.debug("discover() - " + hmcId);
log.debug("discover()");
Map<String, LogicalPartition> tmpPartitions = new HashMap<>();
@ -120,7 +125,7 @@ class HmcInstance implements Runnable {
// Add to list of known systems
if(!systems.containsKey(systemId)) {
systems.put(systemId, system);
log.info("discover() - Found ManagedSystem: " + system + " @" + hmcId);
log.info("discover() - Found ManagedSystem: " + system);
hmcRestClient.enableEnergyMonitoring(system);
}

View File

@ -240,7 +240,7 @@ public class HmcRestClient {
*/
String getPcmDataForManagedSystem(ManagedSystem system) throws Exception {
log.debug("getPcmDataForManagedSystem() - " + system.id);
log.trace("getPcmDataForManagedSystem() - " + system.id);
URL url = new URL(String.format("%s/rest/api/pcm/ManagedSystem/%s/ProcessedMetrics?NoOfSamples=1", baseUrl, system.id));
String responseBody = sendGetRequest(url);
String jsonBody = null;
@ -259,7 +259,7 @@ public class HmcRestClient {
if(link.attr("type").equals("application/json")) {
String href = link.attr("href");
log.debug("getPcmDataForManagedSystem() - json url: " + href);
log.trace("getPcmDataForManagedSystem() - json url: " + href);
jsonBody = sendGetRequest(new URL(href));
}
@ -278,7 +278,7 @@ public class HmcRestClient {
*/
String getPcmDataForLogicalPartition(LogicalPartition partition) throws Exception {
log.debug(String.format("getPcmDataForLogicalPartition() - %s @ %s", partition.id, partition.system.id));
log.trace(String.format("getPcmDataForLogicalPartition() - %s @ %s", partition.id, partition.system.id));
URL url = new URL(String.format("%s/rest/api/pcm/ManagedSystem/%s/LogicalPartition/%s/ProcessedMetrics?NoOfSamples=1", baseUrl, partition.system.id, partition.id));
String responseBody = sendGetRequest(url);
String jsonBody = null;
@ -297,7 +297,7 @@ public class HmcRestClient {
if(link.attr("type").equals("application/json")) {
String href = link.attr("href");
log.debug("getPcmDataForLogicalPartition() - json url: " + href);
log.trace("getPcmDataForLogicalPartition() - json url: " + href);
jsonBody = sendGetRequest(new URL(href));
}
@ -317,7 +317,7 @@ public class HmcRestClient {
*/
String getPcmDataForEnergy(SystemEnergy systemEnergy) throws Exception {
log.debug("getPcmDataForEnergy() - " + systemEnergy.system.id);
log.trace("getPcmDataForEnergy() - " + systemEnergy.system.id);
URL url = new URL(String.format("%s/rest/api/pcm/ManagedSystem/%s/ProcessedMetrics?Type=Energy&NoOfSamples=1", baseUrl, systemEnergy.system.id));
String responseBody = sendGetRequest(url);
String jsonBody = null;
@ -326,7 +326,7 @@ public class HmcRestClient {
// Do not try to parse empty response
if(responseBody == null || responseBody.isEmpty() || responseBody.length() <= 1) {
responseErrors++;
log.debug("getPcmDataForEnergy() - empty response");
log.trace("getPcmDataForEnergy() - empty response");
return null;
}
@ -337,7 +337,7 @@ public class HmcRestClient {
if(link.attr("type").equals("application/json")) {
String href = link.attr("href");
log.debug("getPcmDataForEnergy() - json url: " + href);
log.trace("getPcmDataForEnergy() - json url: " + href);
jsonBody = sendGetRequest(new URL(href));
}
@ -355,7 +355,7 @@ public class HmcRestClient {
*/
void enableEnergyMonitoring(ManagedSystem system) {
log.debug("enableEnergyMonitoring() - " + system.id);
log.trace("enableEnergyMonitoring() - " + system.id);
try {
URL url = new URL(String.format("%s/rest/api/pcm/ManagedSystem/%s/preferences", baseUrl, system.id));
String responseBody = sendGetRequest(url);
@ -408,7 +408,7 @@ public class HmcRestClient {
*/
private String sendGetRequest(URL url) throws Exception {
log.debug("getResponse() - " + url.toString());
log.trace("getResponse() - " + url.toString());
Request request = new Request.Builder()
.url(url)
@ -447,7 +447,7 @@ public class HmcRestClient {
*/
public String sendPostRequest(URL url, String payload) throws Exception {
log.debug("sendPostRequest() - " + url.toString());
log.trace("sendPostRequest() - " + url.toString());
RequestBody requestBody;
if(payload != null) {
@ -475,7 +475,6 @@ public class HmcRestClient {
throw new IOException("sendPostRequest() - Unexpected response: " + response.code());
}
log.debug("sendPostRequest() - response: " + body);
return body;
}

View File

@ -35,10 +35,6 @@ class InfluxClient {
private final static Logger log = LoggerFactory.getLogger(InfluxClient.class);
//private static final int BATCH_ACTIONS_LIMIT = 5000;
//private static final int BATCH_INTERVAL_DURATION = 1000;
final private String url;
final private String username;
final private String password;
@ -126,7 +122,7 @@ class InfluxClient {
void writeManagedSystem(ManagedSystem system) {
if(system.metrics == null) {
log.debug("writeManagedSystem() - null metrics, skipping");
log.trace("writeManagedSystem() - null metrics, skipping");
return;
}
@ -250,7 +246,7 @@ class InfluxClient {
void writeSystemEnergy(SystemEnergy system) {
if(system.metrics == null) {
log.debug("writeSystemEnergy() - null metrics, skipping");
log.trace("writeSystemEnergy() - null metrics, skipping");
return;
}
@ -286,7 +282,7 @@ class InfluxClient {
// Iterate fields
m.fields.forEach((fieldName, fieldValue) -> {
log.debug("processMeasurementMap() " + measurement + " - fieldName: " + fieldName + ", fieldValue: " + fieldValue);
log.trace("processMeasurementMap() " + measurement + " - fieldName: " + fieldName + ", fieldValue: " + fieldValue);
Point.Builder builder = Point.measurement(measurement)
.time(timestamp.toEpochMilli(), TimeUnit.MILLISECONDS)
@ -296,7 +292,7 @@ class InfluxClient {
// For each field, we add all tags
m.tags.forEach((tagName, tagValue) -> {
builder.tag(tagName, tagValue);
log.debug("processMeasurementMap() " + measurement + " - tagName: " + tagName + ", tagValue: " + tagValue);
log.trace("processMeasurementMap() " + measurement + " - tagName: " + tagName + ", tagValue: " + tagValue);
});
listOfPoints.add(builder.build());

View File

@ -54,11 +54,11 @@ class LogicalPartition extends MetaSystem {
Map<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", system.name);
tagsMap.put("partition", name);
log.debug("getAffinityScore() - tags: " + tagsMap.toString());
log.trace("getAffinityScore() - tags: " + tagsMap.toString());
Map<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("affinityScore", metrics.systemUtil.sample.lparsUtil.affinityScore);
log.debug("getAffinityScore() - fields: " + fieldsMap.toString());
log.trace("getAffinityScore() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
return list;
@ -72,12 +72,12 @@ class LogicalPartition extends MetaSystem {
Map<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", system.name);
tagsMap.put("partition", name);
log.debug("getMemoryMetrics() - tags: " + tagsMap.toString());
log.trace("getMemoryMetrics() - tags: " + tagsMap.toString());
Map<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("logicalMem", metrics.systemUtil.sample.lparsUtil.memory.logicalMem);
fieldsMap.put("backedPhysicalMem", metrics.systemUtil.sample.lparsUtil.memory.backedPhysicalMem);
log.debug("getMemoryMetrics() - fields: " + fieldsMap.toString());
log.trace("getMemoryMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
return list;
@ -91,7 +91,7 @@ class LogicalPartition extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", system.name);
tagsMap.put("partition", name);
log.debug("getProcessorMetrics() - tags: " + tagsMap.toString());
log.trace("getProcessorMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("utilizedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedProcUnits);
@ -105,7 +105,7 @@ class LogicalPartition extends MetaSystem {
fieldsMap.put("utilizedUncappedProcUnits", metrics.systemUtil.sample.lparsUtil.processor.utilizedUncappedProcUnits);
fieldsMap.put("timePerInstructionExecution", metrics.systemUtil.sample.lparsUtil.processor.timeSpentWaitingForDispatch);
fieldsMap.put("timeSpentWaitingForDispatch", metrics.systemUtil.sample.lparsUtil.processor.timePerInstructionExecution);
log.debug("getProcessorMetrics() - fields: " + fieldsMap.toString());
log.trace("getProcessorMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
return list;
@ -125,14 +125,14 @@ class LogicalPartition extends MetaSystem {
tagsMap.put("viosId", adapter.viosId.toString());
tagsMap.put("vlanId", adapter.vlanId.toString());
tagsMap.put("vswitchId", adapter.vswitchId.toString());
log.debug("getVirtualEthernetAdapterMetrics() - tags: " + tagsMap.toString());
log.trace("getVirtualEthernetAdapterMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("receivedPhysicalBytes", adapter.receivedPhysicalBytes);
fieldsMap.put("sentPhysicalBytes", adapter.sentPhysicalBytes);
fieldsMap.put("receivedBytes", adapter.receivedBytes);
fieldsMap.put("sentBytes", adapter.sentBytes);
log.debug("getVirtualEthernetAdapterMetrics() - fields: " + fieldsMap.toString());
log.trace("getVirtualEthernetAdapterMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -151,13 +151,13 @@ class LogicalPartition extends MetaSystem {
tagsMap.put("partition", name);
tagsMap.put("viosId", adapter.viosId.toString());
tagsMap.put("wwpn", adapter.wwpn);
log.debug("getVirtualFiberChannelAdaptersMetrics() - tags: " + tagsMap.toString());
log.trace("getVirtualFiberChannelAdaptersMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("transmittedBytes", adapter.transmittedBytes.get(0));
fieldsMap.put("writeBytes", adapter.writeBytes.get(0));
fieldsMap.put("readBytes", adapter.readBytes.get(0));
log.debug("getVirtualFiberChannelAdaptersMetrics() - fields: " + fieldsMap.toString());
log.trace("getVirtualFiberChannelAdaptersMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});

View File

@ -58,14 +58,14 @@ class ManagedSystem extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", name);
log.debug("getMemoryMetrics() - tags: " + tagsMap.toString());
log.trace("getMemoryMetrics() - tags: " + tagsMap.toString());
Map<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("totalMem", metrics.systemUtil.sample.serverUtil.memory.totalMem);
fieldsMap.put("availableMem", metrics.systemUtil.sample.serverUtil.memory.availableMem);
fieldsMap.put("configurableMem", metrics.systemUtil.sample.serverUtil.memory.configurableMem);
fieldsMap.put("assignedMemToLpars", metrics.systemUtil.sample.serverUtil.memory.assignedMemToLpars);
log.debug("getMemoryMetrics() - fields: " + fieldsMap.toString());
log.trace("getMemoryMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
@ -79,14 +79,14 @@ class ManagedSystem extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", name);
log.debug("getProcessorMetrics() - tags: " + tagsMap.toString());
log.trace("getProcessorMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("totalProcUnits", metrics.systemUtil.sample.serverUtil.processor.totalProcUnits);
fieldsMap.put("utilizedProcUnits", metrics.systemUtil.sample.serverUtil.processor.utilizedProcUnits);
fieldsMap.put("availableProcUnits", metrics.systemUtil.sample.serverUtil.processor.availableProcUnits);
fieldsMap.put("configurableProcUnits", metrics.systemUtil.sample.serverUtil.processor.configurableProcUnits);
log.debug("getProcessorMetrics() - fields: " + fieldsMap.toString());
log.trace("getProcessorMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
return list;
@ -101,12 +101,12 @@ class ManagedSystem extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", name);
tagsMap.put("pool", adapter.name);
log.debug("getSharedProcessorPools() - tags: " + tagsMap.toString());
log.trace("getSharedProcessorPools() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("assignedProcUnits", adapter.assignedProcUnits);
fieldsMap.put("availableProcUnits", adapter.availableProcUnits);
log.debug("getSharedProcessorPools() - fields: " + fieldsMap.toString());
log.trace("getSharedProcessorPools() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -124,7 +124,7 @@ class ManagedSystem extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
log.debug("getViosMemoryMetrics() - tags: " + tagsMap.toString());
log.trace("getViosMemoryMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
Number assignedMem = getNumberMetricObject(vios.memory.assignedMem);
@ -139,7 +139,7 @@ class ManagedSystem extends MetaSystem {
Number usedMemPct = (utilizedMem.intValue() * 100 ) / assignedMem.intValue();
fieldsMap.put("utilizedMemPct", usedMemPct.floatValue());
}
log.debug("getViosMemoryMetrics() - fields: " + fieldsMap.toString());
log.trace("getViosMemoryMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -157,7 +157,7 @@ class ManagedSystem extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
log.debug("getViosProcessorMetrics() - tags: " + tagsMap.toString());
log.trace("getViosProcessorMetrics() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("utilizedProcUnits", vios.processor.utilizedProcUnits);
@ -168,7 +168,7 @@ class ManagedSystem extends MetaSystem {
fieldsMap.put("utilizedUncappedProcUnits", vios.processor.utilizedUncappedProcUnits);
fieldsMap.put("timePerInstructionExecution", vios.processor.timeSpentWaitingForDispatch);
fieldsMap.put("timeSpentWaitingForDispatch", vios.processor.timePerInstructionExecution);
log.debug("getViosProcessorMetrics() - fields: " + fieldsMap.toString());
log.trace("getViosProcessorMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -190,13 +190,13 @@ class ManagedSystem extends MetaSystem {
tagsMap.put("type", adapter.type);
tagsMap.put("vios", vios.name);
tagsMap.put("device", adapter.physicalLocation);
log.debug("getSystemSharedAdapters() - tags: " + tagsMap.toString());
log.trace("getSystemSharedAdapters() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("sentBytes", adapter.sentBytes);
fieldsMap.put("receivedBytes", adapter.receivedBytes);
fieldsMap.put("transferredBytes", adapter.transferredBytes);
log.debug("getSystemSharedAdapters() - fields: " + fieldsMap.toString());
log.trace("getSystemSharedAdapters() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -211,7 +211,7 @@ class ManagedSystem extends MetaSystem {
List<Measurement> list = new ArrayList<>();
metrics.systemUtil.sample.viosUtil.forEach( vios -> {
log.debug("getSystemFiberChannelAdapters() - VIOS: " + vios.name);
log.trace("getSystemFiberChannelAdapters() - VIOS: " + vios.name);
vios.storage.fiberChannelAdapters.forEach( adapter -> {
@ -221,13 +221,13 @@ class ManagedSystem extends MetaSystem {
tagsMap.put("wwpn", adapter.wwpn);
tagsMap.put("vios", vios.name);
tagsMap.put("device", adapter.physicalLocation);
log.debug("getSystemFiberChannelAdapters() - tags: " + tagsMap.toString());
log.trace("getSystemFiberChannelAdapters() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("writeBytes", adapter.writeBytes);
fieldsMap.put("readBytes", adapter.readBytes);
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
log.debug("getSystemFiberChannelAdapters() - fields: " + fieldsMap.toString());
log.trace("getSystemFiberChannelAdapters() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -253,13 +253,13 @@ class ManagedSystem extends MetaSystem {
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
tagsMap.put("device", adapter.physicalLocation);
log.debug("getSystemGenericPhysicalAdapters() - tags: " + tagsMap.toString());
log.trace("getSystemGenericPhysicalAdapters() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
fieldsMap.put("writeBytes", adapter.writeBytes);
fieldsMap.put("readBytes", adapter.readBytes);
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
log.debug("getSystemGenericPhysicalAdapters() - fields: " + fieldsMap.toString());
log.trace("getSystemGenericPhysicalAdapters() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -286,13 +286,13 @@ class ManagedSystem extends MetaSystem {
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
tagsMap.put("device", adapter.physicalLocation);
log.debug("getSystemGenericVirtualAdapters() - tags: " + tagsMap.toString());
log.trace("getSystemGenericVirtualAdapters() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<String, Number>();
fieldsMap.put("writeBytes", adapter.writeBytes);
fieldsMap.put("readBytes", adapter.readBytes);
fieldsMap.put("transmittedBytes", adapter.transmittedBytes);
log.debug("getSystemGenericVirtualAdapters() - fields: " + fieldsMap.toString());
log.trace("getSystemGenericVirtualAdapters() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});
@ -316,12 +316,12 @@ class ManagedSystem extends MetaSystem {
tagsMap.put("system", name);
tagsMap.put("vios", vios.name);
tagsMap.put("device", adapter.physicalLocation);
log.debug("getSystemGenericVirtualAdapters() - tags: " + tagsMap.toString());
log.trace("getSystemGenericVirtualAdapters() - tags: " + tagsMap.toString());
HashMap<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("sentBytes", adapter.sentBytes);
fieldsMap.put("receivedBytes", adapter.receivedBytes);
log.debug("getSystemGenericVirtualAdapters() - fields: " + fieldsMap.toString());
log.trace("getSystemGenericVirtualAdapters() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
});

View File

@ -66,10 +66,10 @@ abstract class MetaSystem {
String timestamp = getStringMetricObject(metrics.systemUtil.sample.sampleInfo.timeStamp);
Instant instant = Instant.now();
try {
log.debug("getTimeStamp() - PMC Timestamp: " + timestamp);
log.trace("getTimeStamp() - PMC Timestamp: " + timestamp);
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[XXX][X]");
instant = Instant.from(dateTimeFormatter.parse(timestamp));
log.debug("getTimestamp() - Instant: " + instant.toString());
log.trace("getTimestamp() - Instant: " + instant.toString());
} catch(DateTimeParseException e) {
log.warn("getTimestamp() - parse error: " + timestamp);
}

View File

@ -48,11 +48,11 @@ class SystemEnergy extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", system.name);
log.debug("getPowerMetrics() - tags: " + tagsMap.toString());
log.trace("getPowerMetrics() - tags: " + tagsMap.toString());
Map<String, Number> fieldsMap = new HashMap<>();
fieldsMap.put("powerReading", metrics.systemUtil.sample.energyUtil.powerUtil.powerReading);
log.debug("getPowerMetrics() - fields: " + fieldsMap.toString());
log.trace("getPowerMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
return list;
@ -65,7 +65,7 @@ class SystemEnergy extends MetaSystem {
HashMap<String, String> tagsMap = new HashMap<>();
tagsMap.put("system", system.name);
log.debug("getThermalMetrics() - tags: " + tagsMap.toString());
log.trace("getThermalMetrics() - tags: " + tagsMap.toString());
Map<String, Number> fieldsMap = new HashMap<>();
@ -82,7 +82,7 @@ class SystemEnergy extends MetaSystem {
fieldsMap.put("baseboardTemperature_" + t.entityInstance, t.temperatureReading);
}*/
log.debug("getThermalMetrics() - fields: " + fieldsMap.toString());
log.trace("getThermalMetrics() - fields: " + fieldsMap.toString());
list.add(new Measurement(tagsMap, fieldsMap));
return list;
}

View File

@ -10,21 +10,21 @@ public class FiberChannelAdapter {
public Integer numOfPorts = 0;
@FirstElement
public Number numOfReads;
public Number numOfReads = 0.0;
@FirstElement
public Number numOfWrites;
public Number numOfWrites = 0.0;
@FirstElement
public Number readBytes;
public Number readBytes = 0.0;
@FirstElement
public Number writeBytes;
public Number writeBytes = 0.0;
@FirstElement
public Number runningSpeed;
public Number runningSpeed = 0.0;
@FirstElement
public Number transmittedBytes;
public Number transmittedBytes = 0.0;
}

View File

@ -9,18 +9,18 @@ public class GenericPhysicalAdapters {
public String physicalLocation = "";
@FirstElement
public Number numOfReads;
public Number numOfReads = 0.0;
@FirstElement
public Number numOfWrites;
public Number numOfWrites = 0.0;
@FirstElement
public Number readBytes;
public Number readBytes = 0.0;
@FirstElement
public Number writeBytes;
public Number writeBytes = 0.0;
@FirstElement
public Number transmittedBytes;
public Number transmittedBytes = 0.0;
}

View File

@ -11,18 +11,18 @@ public class GenericVirtualAdapter {
public String physicalLocation = "";
@FirstElement
public Number numOfReads;
public Number numOfReads = 0.0;
@FirstElement
public Number numOfWrites;
public Number numOfWrites = 0.0;
@FirstElement
public Number readBytes;
public Number readBytes = 0.0;
@FirstElement
public Number writeBytes;
public Number writeBytes = 0.0;
@FirstElement
public Number transmittedBytes;
public Number transmittedBytes = 0.0;
}

View File

@ -5,12 +5,12 @@ import com.serjltt.moshi.adapters.FirstElement;
public class LparMemory {
@FirstElement
public Number logicalMem;
public Number logicalMem = 0.0;
@FirstElement
public Number utilizedMem;
public Number utilizedMem = 0.0;
@FirstElement
public Number backedPhysicalMem;
public Number backedPhysicalMem = 0.0;
}

View File

@ -9,36 +9,36 @@ public class LparProcessor {
public String mode = "";
@FirstElement
public Number maxVirtualProcessors;
public Number maxVirtualProcessors = 0.0;
@FirstElement
public Number currentVirtualProcessors;
public Number currentVirtualProcessors = 0.0;
@FirstElement
public Number maxProcUnits;
public Number maxProcUnits = 0.0;
@FirstElement
public Number entitledProcUnits;
public Number entitledProcUnits = 0.0;
@FirstElement
public Number utilizedProcUnits;
public Number utilizedProcUnits = 0.0;
@FirstElement
public Number utilizedCappedProcUnits;
public Number utilizedCappedProcUnits = 0.0;
@FirstElement
public Number utilizedUncappedProcUnits;
public Number utilizedUncappedProcUnits = 0.0;
@FirstElement
public Number idleProcUnits;
public Number idleProcUnits = 0.0;
@FirstElement
public Number donatedProcUnits;
public Number donatedProcUnits = 0.0;
@FirstElement
public Number timeSpentWaitingForDispatch;
public Number timeSpentWaitingForDispatch = 0.0;
@FirstElement
public Number timePerInstructionExecution;
public Number timePerInstructionExecution = 0.0;
}

View File

@ -6,6 +6,6 @@ import com.serjltt.moshi.adapters.FirstElement;
public class PowerUtil {
@FirstElement
public Float powerReading = 0.0f;
public Number powerReading = 0.0;
}

View File

@ -5,15 +5,15 @@ import com.serjltt.moshi.adapters.FirstElement;
public class ServerMemory {
@FirstElement
public Number totalMem = 0;
public Number totalMem = 0.0;
@FirstElement
public Number availableMem = 0;
public Number availableMem = 0.0;
@FirstElement
public Number configurableMem = 0;
public Number configurableMem = 0.0;
@FirstElement
public Number assignedMemToLpars = 0;
public Number assignedMemToLpars = 0.0;
}

View File

@ -5,15 +5,15 @@ import com.serjltt.moshi.adapters.FirstElement;
public class ServerProcessor {
@FirstElement
public Number totalProcUnits = 0;
public Number totalProcUnits = 0.0;
@FirstElement
public Number utilizedProcUnits = 0;
public Number utilizedProcUnits = 0.0;
@FirstElement
public Number availableProcUnits = 0;
public Number availableProcUnits = 0.0;
@FirstElement
public Number configurableProcUnits = 0;
public Number configurableProcUnits = 0.0;
}

View File

@ -9,22 +9,22 @@ public class SharedAdapter {
public String physicalLocation = "";
@FirstElement
public Number receivedPackets = 0;
public Number receivedPackets = 0.0;
@FirstElement
public Number sentPackets = 0;
public Number sentPackets = 0.0;
@FirstElement
public Number droppedPackets = 0;
public Number droppedPackets = 0.0;
@FirstElement
public Number sentBytes = 0;
public Number sentBytes = 0.0;
@FirstElement
public Number receivedBytes = 0;
public Number receivedBytes = 0.0;
@FirstElement
public Number transferredBytes = 0;
public Number transferredBytes = 0.0;
@FirstElement
public String bridgedAdapters = "";

View File

@ -8,18 +8,18 @@ public class SharedProcessorPool {
public String name = "";
@FirstElement
public Number assignedProcUnits = 0;
public Number assignedProcUnits = 0.0;
@FirstElement
public Number utilizedProcUnits = 0;
public Number utilizedProcUnits = 0.0;
@FirstElement
public Number availableProcUnits = 0;
public Number availableProcUnits = 0.0;
@FirstElement
public Number configuredProcUnits = 0;
public Number configuredProcUnits = 0.0;
@FirstElement
public Number borrowedProcUnits = 0;
public Number borrowedProcUnits = 0.0;
}

View File

@ -8,6 +8,6 @@ public class Temperature {
public String entityInstance = "";
@FirstElement
public Float temperatureReading = 0.0f;
public Number temperatureReading = 0.0;
}

View File

@ -5,9 +5,9 @@ import com.serjltt.moshi.adapters.FirstElement;
public class ViosMemory {
@FirstElement
public Number assignedMem = 0;
public Number assignedMem = 0.0;
@FirstElement
public Number utilizedMem = 0;
public Number utilizedMem = 0.0;
}

View File

@ -8,44 +8,44 @@ public class VirtualEthernetAdapter {
public String physicalLocation = "";
public Integer vlanId = 0;
public Integer vswitchId = 0;
public Boolean isPortVlanId = false;
public Boolean isPortVlanId = false;
public Integer viosId = 0;
public String sharedEthernetAdapterId = "";
@FirstElement
public Number receivedPackets = 0;
public Number receivedPackets = 0.0;
@FirstElement
public Number sentPackets = 0;
public Number sentPackets = 0.0;
@FirstElement
public Number droppedPackets = 0;
public Number droppedPackets = 0.0;
@FirstElement
public Number sentBytes = 0;
public Number sentBytes = 0.0;
@FirstElement
public Number receivedBytes = 0;
public Number receivedBytes = 0.0;
@FirstElement
public Number receivedPhysicalPackets = 0;
public Number receivedPhysicalPackets = 0.0;
@FirstElement
public Number sentPhysicalPackets = 0;
public Number sentPhysicalPackets = 0.0;
@FirstElement
public Number droppedPhysicalPackets = 0;
public Number droppedPhysicalPackets = 0.0;
@FirstElement
public Number sentPhysicalBytes = 0;
public Number sentPhysicalBytes = 0.0;
@FirstElement
public Number receivedPhysicalBytes = 0;
public Number receivedPhysicalBytes = 0.0;
@FirstElement
public Number transferredBytes = 0;
public Number transferredBytes = 0.0;
@FirstElement
public Number transferredPhysicalBytes = 0;
public Number transferredPhysicalBytes = 0.0;
}