summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-04-10 10:19:24 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2024-04-10 10:19:24 +0200
commit9425acf3b60788a6f6b2c0b31a2a0fc8654c47c0 (patch)
tree908f5022aeb5137343153c364711b63a51a51664
parent43e889860f4cefad8d4d55c7276966656171be64 (diff)
Follow api change
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/QuestMetricsDb.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/QuestMetricsDb.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/QuestMetricsDb.java
index e9230d2c91a..057430b381f 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/QuestMetricsDb.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/QuestMetricsDb.java
@@ -296,6 +296,11 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb {
}
}
+ private static String getStr(Record record, int col) {
+ CharSequence charSequence = record.getStrA(col);
+ return charSequence != null ? charSequence.toString() : "";
+ }
+
private ListMap<String, NodeMetricSnapshot> getNodeSnapshots(Instant startTime,
Set<String> hostnames,
SqlExecutionContext context) throws SqlException {
@@ -312,7 +317,7 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb {
try (RecordCursor cursor = factory.getCursor(context)) {
Record record = cursor.getRecord();
while (cursor.hasNext()) {
- String hostname = record.getStr(0).toString();
+ String hostname = getStr(record, 0);
if (hostnames.isEmpty() || hostnames.contains(hostname)) {
snapshots.put(hostname,
new NodeMetricSnapshot(Instant.ofEpochMilli(record.getTimestamp(1) / 1000),
@@ -345,9 +350,9 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb {
try (RecordCursor cursor = factory.getCursor(context)) {
Record record = cursor.getRecord();
while (cursor.hasNext()) {
- String applicationIdString = record.getStr(0).toString();
+ String applicationIdString = getStr(record, 0);
if ( ! application.serializedForm().equals(applicationIdString)) continue;
- String clusterId = record.getStr(1).toString();
+ String clusterId = getStr(record, 1);
if (cluster.value().equals(clusterId)) {
snapshots.add(new ClusterMetricSnapshot(Instant.ofEpochMilli(record.getTimestamp(2) / 1000),
record.getFloat(3),
@@ -475,7 +480,7 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb {
try (RecordCursor cursor = factory.getCursor(context)) {
Record record = cursor.getRecord();
while (cursor.hasNext()) {
- columns.add(record.getStr(0).toString());
+ columns.add(getStr(record, 0));
}
}
}