Skip to content

Commit

Permalink
Add metric to record the number of get requests targetting at out of …
Browse files Browse the repository at this point in the history
…retention blobs (#2897)

Add a new metric to record the number of get requests targeting at out of retention blobs.
  • Loading branch information
justinlin-linkedin authored Sep 23, 2024
1 parent f8bb6f3 commit c9b8865
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,11 @@ BlobReadOptions getBlobReadInfo(StoreKey id, EnumSet<StoreGetOptions> getOptions
if (!getOptions.contains(StoreGetOptions.Store_Include_Deleted)) {
throw new StoreException("Id " + id + " has been deleted in index " + dataDir, StoreErrorCodes.ID_Deleted);
} else {
if (value.getOperationTimeInMs() + TimeUnit.MINUTES.toMillis(config.storeDeletedMessageRetentionMinutes)
< time.milliseconds()) {
// fetching a blob that was deleted more than the retention minutes.
metrics.getOutOfRetentionDeletedBlobCount.inc();
}
readOptions = getDeletedBlobReadOptions(value, id, indexSegments);
}
} else if (isExpired(value) && !getOptions.contains(StoreGetOptions.Store_Include_Expired)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class StoreMetrics {
public final Counter generateTokenBasedOnCompactionHistoryCount;
public final Counter offsetFoundInBeforeAfterMapCount;
public final Counter beforeAndAfterOffsetSanityCheckFailureCount;
public final Counter getOutOfRetentionDeletedBlobCount;
public final Timer recoveryTime;
public final Timer findTime;
public final Timer indexFlushTime;
Expand Down Expand Up @@ -189,6 +190,8 @@ public StoreMetrics(String prefix, MetricRegistry registry) {
registry.counter(MetricRegistry.name(PersistentIndex.class, name + "OffsetFoundInBeforeAfterMapCount"));
beforeAndAfterOffsetSanityCheckFailureCount = registry.counter(
MetricRegistry.name(PersistentIndex.class, name + "BeforeAndAfterOffsetSanityCheckFailureCount"));
getOutOfRetentionDeletedBlobCount =
registry.counter(MetricRegistry.name(PersistentIndex.class, name + "GetOutOfRetentionDeletedBlobCount"));
recoveryTime = registry.timer(MetricRegistry.name(PersistentIndex.class, name + "IndexRecoveryTime"));
findTime = registry.timer(MetricRegistry.name(PersistentIndex.class, name + "IndexFindTime"));
indexFlushTime = registry.timer(MetricRegistry.name(PersistentIndex.class, name + "IndexFlushTime"));
Expand Down

0 comments on commit c9b8865

Please sign in to comment.