Don't count backup metrics on TTL refresh

This commit is contained in:
Ravi Khadiwala
2025-09-11 13:55:02 -05:00
committed by ravi-signal
parent 8f65486fab
commit 31ebe9071a
2 changed files with 28 additions and 14 deletions

View File

@@ -254,8 +254,7 @@ public class BackupsDb {
.updateItemBuilder()
.returnValues(ReturnValue.ALL_OLD)
.build())
.thenAccept(updateItemResponse ->
updateMetricsAfterRefresh(backupUser, today, updateItemResponse.attributes()));
.thenRun(Util.NOOP);
}
/**
@@ -274,10 +273,10 @@ public class BackupsDb {
.returnValues(ReturnValue.ALL_OLD)
.build())
.thenAccept(updateItemResponse ->
updateMetricsAfterRefresh(backupUser, today, updateItemResponse.attributes()));
updateMetricsAfterUpload(backupUser, today, updateItemResponse.attributes()));
}
private void updateMetricsAfterRefresh(final AuthenticatedBackupUser backupUser, final Instant today, final Map<String, AttributeValue> item) {
private void updateMetricsAfterUpload(final AuthenticatedBackupUser backupUser, final Instant today, final Map<String, AttributeValue> item) {
final Instant previousRefreshTime = Instant.ofEpochSecond(
AttributeValues.getLong(item, ATTR_LAST_REFRESH, 0L));
// Only publish a metric update once per day