Skip to content

Commit

Permalink
Merge pull request #1153 from elandau/ignore_staleness
Browse files Browse the repository at this point in the history
Tweak Staleness metrics
  • Loading branch information
elandau authored Nov 14, 2018
2 parents 44bf4ca + 3115ee4 commit 41bc0a1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,10 @@ public long getLastSuccessfulRegistryFetchTimePeriod() {
@com.netflix.servo.annotations.Monitor(name = METRIC_REGISTRATION_PREFIX + "lastSuccessfulHeartbeatTimePeriod",
description = "How much time has passed from last successful heartbeat", type = DataSourceType.GAUGE)
private long getLastSuccessfulHeartbeatTimePeriodInternal() {
long delay = getLastSuccessfulHeartbeatTimePeriod();
final long delay = (!clientConfig.shouldRegisterWithEureka() || isShutdown.get())
? 0
: getLastSuccessfulHeartbeatTimePeriod();

heartbeatStalenessMonitor.update(computeStalenessMonitorDelay(delay));
return delay;
}
Expand All @@ -1686,7 +1689,10 @@ private long getLastSuccessfulHeartbeatTimePeriodInternal() {
@com.netflix.servo.annotations.Monitor(name = METRIC_REGISTRY_PREFIX + "lastSuccessfulRegistryFetchTimePeriod",
description = "How much time has passed from last successful local registry update", type = DataSourceType.GAUGE)
private long getLastSuccessfulRegistryFetchTimePeriodInternal() {
long delay = getLastSuccessfulRegistryFetchTimePeriod();
final long delay = (!clientConfig.shouldFetchRegistry() || isShutdown.get())
? 0
: getLastSuccessfulRegistryFetchTimePeriod();

registryStalenessMonitor.update(computeStalenessMonitorDelay(delay));
return delay;
}
Expand Down

0 comments on commit 41bc0a1

Please sign in to comment.