Skip to content

Commit 3c9ba6d

Browse files
authored
Merge pull request #698 from Netflix/update-start-end-time
fix how we record cycle start and end time
2 parents a254ddb + deef34d commit 3c9ba6d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hollow/src/main/java/com/netflix/hollow/api/client/HollowClientUpdater.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public synchronized boolean updateTo(long requestedVersion) throws Throwable {
117117
return updateTo(new HollowConsumer.VersionInfo(requestedVersion));
118118
}
119119
public synchronized boolean updateTo(HollowConsumer.VersionInfo requestedVersionInfo) throws Throwable {
120-
metrics.setLastRefreshStartNs(System.nanoTime());
121120
long requestedVersion = requestedVersionInfo.getVersion();
122121
if (requestedVersion == getCurrentVersionId()) {
123122
if (requestedVersion == HollowConstants.VERSION_NONE && hollowDataHolderVolatile == null) {
@@ -128,6 +127,7 @@ public synchronized boolean updateTo(HollowConsumer.VersionInfo requestedVersion
128127
}
129128
return true;
130129
}
130+
metrics.setLastRefreshStartNs(System.nanoTime());
131131

132132
// Take a snapshot of the listeners to ensure additions or removals may occur concurrently
133133
// but will not take effect until a subsequent refresh
@@ -168,8 +168,10 @@ public synchronized boolean updateTo(HollowConsumer.VersionInfo requestedVersion
168168
&& requestedVersion == HollowConstants.VERSION_LATEST)
169169
throw new IllegalArgumentException("Could not create an update plan, because no existing versions could be retrieved.");
170170

171-
if (updatePlan.destinationVersion(requestedVersion) == getCurrentVersionId())
171+
if (updatePlan.destinationVersion(requestedVersion) == getCurrentVersionId()) {
172+
metrics.setLastRefreshEndNs(System.nanoTime());
172173
return true;
174+
}
173175

174176
if (updatePlan.isSnapshotPlan()) { // 1 snapshot and 0+ delta transitions
175177
HollowDataHolder oldDh = hollowDataHolderVolatile;

0 commit comments

Comments
 (0)