File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
eureka-client/src/main/java/com/netflix/discovery Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1677,6 +1677,10 @@ public long getLastSuccessfulRegistryFetchTimePeriod() {
16771677 @ com .netflix .servo .annotations .Monitor (name = METRIC_REGISTRATION_PREFIX + "lastSuccessfulHeartbeatTimePeriod" ,
16781678 description = "How much time has passed from last successful heartbeat" , type = DataSourceType .GAUGE )
16791679 private long getLastSuccessfulHeartbeatTimePeriodInternal () {
1680+ if (!clientConfig .shouldRegisterWithEureka () || isShutdown .get ()) {
1681+ heartbeatStalenessMonitor .update (0 );
1682+ return 0 ;
1683+ }
16801684 long delay = getLastSuccessfulHeartbeatTimePeriod ();
16811685 heartbeatStalenessMonitor .update (computeStalenessMonitorDelay (delay ));
16821686 return delay ;
@@ -1686,6 +1690,10 @@ private long getLastSuccessfulHeartbeatTimePeriodInternal() {
16861690 @ com .netflix .servo .annotations .Monitor (name = METRIC_REGISTRY_PREFIX + "lastSuccessfulRegistryFetchTimePeriod" ,
16871691 description = "How much time has passed from last successful local registry update" , type = DataSourceType .GAUGE )
16881692 private long getLastSuccessfulRegistryFetchTimePeriodInternal () {
1693+ if (!clientConfig .shouldFetchRegistry () || isShutdown .get ()) {
1694+ registryStalenessMonitor .update (0 );
1695+ return 0 ;
1696+ }
16891697 long delay = getLastSuccessfulRegistryFetchTimePeriod ();
16901698 registryStalenessMonitor .update (computeStalenessMonitorDelay (delay ));
16911699 return delay ;
You can’t perform that action at this time.
0 commit comments