Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
[CHERRY PICK] Adding a additional check to just process first 50 obje…
Browse files Browse the repository at this point in the history
  • Loading branch information
psychbot authored and Khushboo Rajput committed Mar 3, 2021
1 parent 8cf28ba commit 4ab4a0b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public class ShardIndexingPressureMetricsCollector extends PerformanceAnalyzerMe
public static final String SHARD_INDEXING_PRESSURE_STORE_FIELD_NAME = "shardIndexingPressureStore";
public static final String SHARD_INDEXING_PRESSURE_HOT_STORE_FIELD_NAME = "shardIndexingPressureHotStore";

private static final Integer MAX_HOT_STORE_LIMIT = 50;

private final ConfigOverridesWrapper configOverridesWrapper;
private final PerformanceAnalyzerController controller;
private StringBuilder value;
Expand Down Expand Up @@ -86,7 +88,7 @@ public void collectMetrics(long startTime) {
.get(shardIndexingPressureStore);

value.setLength(0);
shardIndexingPressureHotStore.entrySet().stream().forEach(storeObject -> {
shardIndexingPressureHotStore.entrySet().stream().limit(MAX_HOT_STORE_LIMIT).forEach(storeObject -> {
try {
JSONObject tracker = (JSONObject) parser.parse(mapper.writeValueAsString(storeObject.getValue()));
JSONObject shardId = (JSONObject) parser.parse(mapper.writeValueAsString(tracker.get("shardId")));
Expand Down

0 comments on commit 4ab4a0b

Please sign in to comment.