Fixing a metrics bug

This commit is contained in:
Ashwin Giridharan 2020-04-29 15:56:15 -07:00
parent bdec3bd66d
commit 4a323b8f1c
2 changed files with 5 additions and 4 deletions

View file

@ -163,7 +163,6 @@ public class Lease {
pendingCheckpointState(lease.pendingCheckpointState); pendingCheckpointState(lease.pendingCheckpointState);
parentShardIds(lease.parentShardIds); parentShardIds(lease.parentShardIds);
childShardIds(lease.childShardIds); childShardIds(lease.childShardIds);
hashKeyRange(lease.hashKeyRangeForLease);
} }
/** /**
@ -283,7 +282,7 @@ public class Lease {
* Set the hash range key for this shard. * Set the hash range key for this shard.
* @param hashKeyRangeForLease * @param hashKeyRangeForLease
*/ */
public void hashKeyRange(final HashKeyRangeForLease hashKeyRangeForLease) { public void hashKeyRange(HashKeyRangeForLease hashKeyRangeForLease) {
if (this.hashKeyRangeForLease == null) { if (this.hashKeyRangeForLease == null) {
this.hashKeyRangeForLease = hashKeyRangeForLease; this.hashKeyRangeForLease = hashKeyRangeForLease;
} else if (!this.hashKeyRangeForLease.equals(hashKeyRangeForLease)) { } else if (!this.hashKeyRangeForLease.equals(hashKeyRangeForLease)) {

View file

@ -302,9 +302,11 @@ public class DynamoDBLeaseRenewer implements LeaseRenewer {
if(lease instanceof MultiStreamLease) { if(lease instanceof MultiStreamLease) {
MetricsUtil.addStreamId(scope, MetricsUtil.addStreamId(scope,
StreamIdentifier.multiStreamInstance(((MultiStreamLease) lease).streamIdentifier())); StreamIdentifier.multiStreamInstance(((MultiStreamLease) lease).streamIdentifier()));
} MetricsUtil.addShardId(scope, ((MultiStreamLease) lease).shardId());
} else {
MetricsUtil.addShardId(scope, shardId); MetricsUtil.addShardId(scope, shardId);
} }
}
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
boolean success = false; boolean success = false;