diff options
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted')
3 files changed, 20 insertions, 34 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricSnapshot.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricSnapshot.java index 82812592809..d5072475cd9 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricSnapshot.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricSnapshot.java @@ -18,11 +18,9 @@ public class MetricSnapshot implements Comparable<MetricSnapshot> { private final long generation; private final boolean inService; private final boolean stable; - private final double queryRate; - public MetricSnapshot(Instant at, double cpu, double memory, double disk, - long generation, boolean inService, boolean stable, - double queryRate) { + public MetricSnapshot(Instant at, double cpu, double memory, double disk, long generation, + boolean inService, boolean stable) { this.at = at; this.cpu = cpu; this.memory = memory; @@ -30,7 +28,6 @@ public class MetricSnapshot implements Comparable<MetricSnapshot> { this.generation = generation; this.inService = inService; this.stable = stable; - this.queryRate = queryRate; } public Instant at() { return at; } @@ -38,9 +35,6 @@ public class MetricSnapshot implements Comparable<MetricSnapshot> { public double memory() { return memory; } public double disk() { return disk; } - /** Queries per second */ - public double queryRate() { return queryRate; } - /** The configuration generation at the time of this measurement, or -1 if not known */ public long generation() { return generation; } @@ -59,8 +53,7 @@ public class MetricSnapshot implements Comparable<MetricSnapshot> { " disk: " + disk + " generation: " + generation + " inService: " + inService + - " stable: " + stable + - " queryRate: " + queryRate; + " stable: " + stable; } } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java index d6661b89536..341a2028f05 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/autoscale/MetricsResponse.java @@ -65,8 +65,7 @@ public class MetricsResponse { Metric.disk.from(values), (long)Metric.generation.from(values), Metric.inService.from(values) > 0, - clusterIsStable(node.get(), applicationNodes, nodeRepository), - Metric.queryRate.from(values)))); + clusterIsStable(node.get(), applicationNodes, nodeRepository)))); } private boolean clusterIsStable(Node node, NodeList applicationNodes, NodeRepository nodeRepository) { @@ -116,11 +115,6 @@ public class MetricsResponse { public String metricResponseName() { return "in_service"; } double convertValue(double metricValue) { return (float)metricValue; } // Really a boolean double defaultValue() { return 1.0; } - }, - queryRate { // queries per second - public String metricResponseName() { return "queries.rate"; } - double convertValue(double metricValue) { return (float)metricValue; } - double defaultValue() { return 0.0; } }; /** The name of this metric as emitted from its source */ 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 37e70e3539a..81401f9f743 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 @@ -110,7 +110,6 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb { row.putLong(5, snapshot.getSecond().generation()); row.putBool(6, snapshot.getSecond().inService()); row.putBool(7, snapshot.getSecond().stable()); - row.putFloat(8, (float)snapshot.getSecond().queryRate()); row.append(); } writer.commit(); @@ -184,17 +183,28 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb { private void ensureExists(String table) { SqlExecutionContext context = newContext(); if (0 == engine.getStatus(context.getCairoSecurityContext(), new Path(), table)) { // table exists - ensureTableIsUpdated(table, context); + ensureUpdated(table, context); } else { - createTable(table, context); + create(table, context); } } - private void createTable(String table, SqlExecutionContext context) { + private void ensureUpdated(String table, SqlExecutionContext context) { + try (SqlCompiler compiler = new SqlCompiler(engine)) { + if (0 == engine.getStatus(context.getCairoSecurityContext(), new Path(), table)) { + ensureColumnExists("inService", "boolean", table, compiler, context); // TODO: Remove after December 2020 + ensureColumnExists("stable", "boolean", table, compiler, context); // TODO: Remove after December 2020 + } + } catch (SqlException e) { + repair(e); + } + } + + private void create(String table, SqlExecutionContext context) { try (SqlCompiler compiler = new SqlCompiler(engine)) { compiler.compile("create table " + table + " (hostname string, at timestamp, cpu_util float, mem_total_util float, disk_util float," + - " application_generation long, inService boolean, stable boolean, queries_rate float)" + + " application_generation long, inService boolean, stable boolean)" + " timestamp(at)" + "PARTITION BY DAY;", context); @@ -206,16 +216,6 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb { } } - private void ensureTableIsUpdated(String table, SqlExecutionContext context) { - try (SqlCompiler compiler = new SqlCompiler(engine)) { - if (0 == engine.getStatus(context.getCairoSecurityContext(), new Path(), table)) { - ensureColumnExists("queries_rate", "float", table, compiler, context); // TODO: Remove after March 2021 - } - } catch (SqlException e) { - repair(e); - } - } - private void ensureColumnExists(String column, String columnType, String table, SqlCompiler compiler, SqlExecutionContext context) throws SqlException { if (columnNamesOf(table, compiler, context).contains(column)) return; @@ -272,8 +272,7 @@ public class QuestMetricsDb extends AbstractComponent implements MetricsDb { record.getFloat(4), record.getLong(5), record.getBool(6), - record.getBool(7), - record.getFloat(8))); + record.getBool(7))); } } } |