Skip to content

Commit ce0466b

Browse files
committed
Remove processId arg
1 parent 5871dc0 commit ce0466b

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/common/atlas/performanceAdvisorUtils.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,21 +225,16 @@ export async function getSlowQueries(
225225
projectId: string,
226226
clusterName: string,
227227
since?: Date,
228-
processId?: string,
229228
namespaces?: Array<string>
230229
): Promise<{ slowQueryLogs: Array<SlowQueryLog> }> {
231230
try {
232-
// If processId is not provided, get it from inspecting the cluster
233-
let actualProcessId = processId;
234-
if (!actualProcessId) {
235-
actualProcessId = await getProcessIdFromCluster(apiClient, projectId, clusterName);
236-
}
231+
const processId = await getProcessIdFromCluster(apiClient, projectId, clusterName);
237232

238233
const response = await apiClient.listSlowQueries({
239234
params: {
240235
path: {
241236
groupId: projectId,
242-
processId: actualProcessId,
237+
processId,
243238
},
244239
query: {
245240
...(since && { since: since.getTime() }),

src/tools/atlas/read/listPerformanceAdvisor.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export class ListPerformanceAdvisorTool extends AtlasToolBase {
2828
.default(Object.values(PerformanceAdvisorOperation))
2929
.describe("Operations to list performance advisor recommendations"),
3030
since: z.date().describe("Date to list slow query logs since").optional(),
31-
processId: z.string().describe("Process ID to list slow query logs").optional(),
3231
namespaces: z.array(z.string()).describe("Namespaces to list slow query logs").optional(),
3332
};
3433

@@ -37,7 +36,6 @@ export class ListPerformanceAdvisorTool extends AtlasToolBase {
3736
clusterName,
3837
operations,
3938
since,
40-
processId,
4139
namespaces,
4240
}: ToolArgs<typeof this.argsShape>): Promise<CallToolResult> {
4341
const data: PerformanceAdvisorData = {
@@ -70,7 +68,7 @@ export class ListPerformanceAdvisorTool extends AtlasToolBase {
7068

7169
if (operations.includes(PerformanceAdvisorOperation.SLOW_QUERY_LOGS)) {
7270
performanceAdvisorPromises.push(
73-
getSlowQueries(this.session.apiClient, projectId, clusterName, since, processId, namespaces).then(
71+
getSlowQueries(this.session.apiClient, projectId, clusterName, since, namespaces).then(
7472
({ slowQueryLogs }) => {
7573
data.slowQueryLogs = slowQueryLogs;
7674
}

0 commit comments

Comments
 (0)