diff --git a/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java b/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java index a5697b92e..ad38b8a89 100644 --- a/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java +++ b/service/src/main/java/org/whispersystems/textsecuregcm/auth/BaseAccountAuthenticator.java @@ -29,8 +29,7 @@ public class BaseAccountAuthenticator { private static final String AUTHENTICATION_FAILURE_REASON_TAG_NAME = "reason"; private static final String AUTHENTICATION_ENABLED_REQUIRED_TAG_NAME = "enabledRequired"; - private final String daysSinceLastSeenDistributionName = name(getClass(), "authentication", "daysSinceLastSeen"); - + private static final String DAYS_SINCE_LAST_SEEN_DISTRIBUTION_NAME = name(BaseAccountAuthenticator.class, "daysSinceLastSeen"); private static final String IS_PRIMARY_DEVICE_TAG = "isPrimary"; private final AccountsManager accountsManager; @@ -108,10 +107,7 @@ public class BaseAccountAuthenticator { final long todayInMillisWithOffset = Util.todayInMillisGivenOffsetFromNow(clock, Duration.ofSeconds(lastSeenOffsetSeconds).negated()); if (device.getLastSeen() < todayInMillisWithOffset) { - DistributionSummary.builder(daysSinceLastSeenDistributionName) - .tags(IS_PRIMARY_DEVICE_TAG, String.valueOf(device.isMaster())) - .publishPercentileHistogram() - .register(Metrics.globalRegistry) + Metrics.summary(DAYS_SINCE_LAST_SEEN_DISTRIBUTION_NAME, IS_PRIMARY_DEVICE_TAG, String.valueOf(device.isMaster())) .record(Duration.ofMillis(todayInMillisWithOffset - device.getLastSeen()).toDays()); device.setLastSeen(Util.todayInMillis(clock));