diff options
author | Ola Aunrønning <olaa@verizonmedia.com> | 2022-06-17 14:12:15 +0200 |
---|---|---|
committer | Ola Aunrønning <olaa@verizonmedia.com> | 2022-06-17 14:12:15 +0200 |
commit | ba227e9fd89e75514db94e244ff42352d86dd1ca (patch) | |
tree | abaca29805b88afc161d2bf4cc78f506e5ffbaad /controller-api | |
parent | 657ba053d368c64dc85d751fcfb7b4a0de64fcbe (diff) |
Get age of oldest snapshot
Diffstat (limited to 'controller-api')
2 files changed, 6 insertions, 6 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClient.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClient.java index 8d4a6515f2b..51b5a3c2543 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClient.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClient.java @@ -4,7 +4,9 @@ package com.yahoo.vespa.hosted.controller.api.integration.resource; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.zone.ZoneId; +import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; +import java.time.Instant; import java.time.LocalDate; import java.time.YearMonth; import java.time.temporal.ChronoUnit; @@ -30,7 +32,7 @@ public interface ResourceDatabaseClient { Set<TenantName> getTenants(); - Map<ApplicationId, Set<ZoneId>> getLastSnapshots(); + Instant getOldestSnapshotTimestamp(Set<DeploymentId> deployments); default List<ResourceUsage> getResourceSnapshotsForMonth(TenantName tenantName, YearMonth month) { return getResourceSnapshotsForPeriod(tenantName, getMonthStartTimeStamp(month), getMonthEndTimeStamp(month)); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java index 69378d97787..cf955e38218 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/resource/ResourceDatabaseClientMock.java @@ -5,6 +5,7 @@ import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.ApplicationName; import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.zone.ZoneId; +import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; import com.yahoo.vespa.hosted.controller.api.integration.billing.Plan; import com.yahoo.vespa.hosted.controller.api.integration.billing.PlanRegistry; @@ -129,8 +130,8 @@ public class ResourceDatabaseClientMock implements ResourceDatabaseClient { } @Override - public Map<ApplicationId, Set<ZoneId>> getLastSnapshots() { - return lastSnapshots; + public Instant getOldestSnapshotTimestamp(Set<DeploymentId> deployments) { + return Instant.ofEpochMilli(987654L); } public void setPlan(TenantName tenant, Plan plan) { @@ -141,7 +142,4 @@ public class ResourceDatabaseClientMock implements ResourceDatabaseClient { return hasRefreshedMaterializedView; } - public void setLastSnapshots(Map<ApplicationId, Set<ZoneId>> lastSnapshots) { - this.lastSnapshots = lastSnapshots; - } } |