Skip to content

Commit 54daab4

Browse files
committed
fixing for projectId sort of
1 parent 0f16a93 commit 54daab4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

server/src/main/java/org/elasticsearch/health/WhatIsMyClusterDoingAction.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.elasticsearch.action.support.TransportAction;
3030
import org.elasticsearch.client.internal.node.NodeClient;
3131
import org.elasticsearch.cluster.ClusterName;
32+
import org.elasticsearch.cluster.metadata.ProjectId;
3233
import org.elasticsearch.cluster.node.DiscoveryNode;
3334
import org.elasticsearch.cluster.node.VersionInformation;
3435
import org.elasticsearch.cluster.project.ProjectResolver;
@@ -71,9 +72,8 @@ public class WhatIsMyClusterDoingAction extends ActionType<WhatIsMyClusterDoingA
7172
public static final String NAME = "cluster:monitor/what_is_my_cluster_doing";
7273
// private static final String diagLocation = "/Users/keithmassey/sdh/8676/api-diagnostics-20241231-112131";
7374
// private static final String diagLocation = "/Users/keithmassey/sdh/8689/api-diagnostics-20250108-163913";
74-
private static final String[] diagLocations = {
75-
"/Users/keithmassey/sdh/8924/20240414_2200/api-diagnostics-20250414-152548",
76-
"/Users/keithmassey/sdh/8924/20240414_2000/api-diagnostics-20250414-130554" };
75+
private static final String[] diagLocations = { "/Users/keithmassey/sdh/9271/api-diagnostics-20250910-183143" };
76+
// "/Users/keithmassey/sdh/8924/20240414_2000/api-diagnostics-20250414-130554" };
7777

7878
private WhatIsMyClusterDoingAction() {
7979
super(NAME);
@@ -558,7 +558,7 @@ private void fetchNodesStatsFromDisk(ActionListener<NodesStatsResponse> listener
558558
bytesProduced = producedBytes.longValue();
559559
}
560560
IngestStats.ByteStats byteStats = new IngestStats.ByteStats(bytesIngested, bytesProduced);
561-
IngestStats.PipelineStat pipelineStat = new IngestStats.PipelineStat(pipelineName, stats, byteStats);
561+
IngestStats.PipelineStat pipelineStat = new IngestStats.PipelineStat(ProjectId.DEFAULT, pipelineName, stats, byteStats);
562562
pipelineStats.add(pipelineStat);
563563

564564
List<Map<String, Map<String, Object>>> processors = (List<Map<String, Map<String, Object>>>) pipelineMap.get(
@@ -590,7 +590,7 @@ private void fetchNodesStatsFromDisk(ActionListener<NodesStatsResponse> listener
590590
}
591591
}
592592

593-
IngestStats ingestStats = new IngestStats(totalStats, pipelineStats, processorStats);
593+
IngestStats ingestStats = new IngestStats(totalStats, pipelineStats, Map.of(ProjectId.DEFAULT, processorStats));
594594
NodeStats nodeStats = new NodeStats(
595595
discoveryNode,
596596
0,
@@ -682,7 +682,9 @@ private Map<String, Map<String, PipelineDetails>> getNodeToPipelineMap(
682682
pipelineName,
683683
new PipelineDetails(pipelineName, pipelineTime, totalTimeInMillis, processorMessages)
684684
);
685-
List<IngestStats.ProcessorStat> processors = ingestStats.processorStats().get(pipelineName);
685+
List<IngestStats.ProcessorStat> processors = ingestStats.processorStats()
686+
.get(ProjectId.DEFAULT)
687+
.get(pipelineName);
686688
Collection<Long> nonZeroProcessorTimes = processors.stream()
687689
.map(stat -> stat.stats().ingestTimeInMillis())
688690
.filter(stat -> stat > 0)
@@ -938,6 +940,9 @@ private static Tuple<List<String>, String> getSummaryOfElasticStackForOneThread(
938940
} else if (stackElement.contains("org.apache.lucene.search.TaskExecutor")) {
939941
reasons.add("executing search requests");
940942
potentialClassifications.add(Classification.SEARCH);
943+
} else {
944+
reasons.add("unknown");
945+
potentialClassifications.add(Classification.UNKNOWN);
941946
}
942947
if (stackElement.contains("elastic") && stackElement.contains("%") == false) {
943948
products.add("elastic");

0 commit comments

Comments
 (0)