diff options
author | Jon Bratseth <bratseth@gmail.com> | 2020-11-23 14:04:53 +0100 |
---|---|---|
committer | Jon Bratseth <bratseth@gmail.com> | 2020-11-23 14:04:53 +0100 |
commit | 6cfcb42e3a3b8945c0f34567f1c495248ae7a135 (patch) | |
tree | 391d917271d17999e68162853319d53ce73798ec /controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java | |
parent | 6fce5dc6185e15aad1ee4e58c291837cf5199c3a (diff) |
Pass more cluster info
Diffstat (limited to 'controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java')
-rw-r--r-- | controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java index fd339e3bb43..98b7ffd1d47 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Cluster.java @@ -4,6 +4,8 @@ package com.yahoo.vespa.hosted.controller.api.integration.configserver; import com.yahoo.config.provision.ClusterResources; import com.yahoo.config.provision.ClusterSpec; +import java.time.Instant; +import java.util.List; import java.util.Optional; /** @@ -17,19 +19,25 @@ public class Cluster { private final ClusterResources current; private final Optional<ClusterResources> target; private final Optional<ClusterResources> suggested; + private final List<ScalingEvent> scalingEvents; + private final String autoscalingStatus; public Cluster(ClusterSpec.Id id, ClusterResources min, ClusterResources max, ClusterResources current, Optional<ClusterResources> target, - Optional<ClusterResources> suggested) { + Optional<ClusterResources> suggested, + List<ScalingEvent> scalingEvents, + String autoscalingStatus) { this.id = id; this.min = min; this.max = max; this.current = current; this.target = target; this.suggested = suggested; + this.scalingEvents = scalingEvents; + this.autoscalingStatus = autoscalingStatus; } public ClusterSpec.Id id() { return id; } @@ -38,10 +46,29 @@ public class Cluster { public ClusterResources current() { return current; } public Optional<ClusterResources> target() { return target; } public Optional<ClusterResources> suggested() { return suggested; } + public List<ScalingEvent> scalingEvents() { return scalingEvents; } + public String autoscalingStatus() { return autoscalingStatus; } @Override public String toString() { return "cluster '" + id + "'"; } + public static class ScalingEvent { + + private final ClusterResources from, to; + private final Instant at; + + public ScalingEvent(ClusterResources from, ClusterResources to, Instant at) { + this.from = from; + this.to = to; + this.at = at; + } + + public ClusterResources from() { return from; } + public ClusterResources to() { return to; } + public Instant at() { return at; } + + } + } |