set mongo profiling

This commit is contained in:
Jan Prochazka
2022-12-09 15:14:21 +01:00
parent e6ac878b74
commit 61dc9da3f0
5 changed files with 66 additions and 7 deletions

View File

@@ -197,4 +197,12 @@ module.exports = {
testConnectionPermission(conid, req);
return this.loadDataCore('serverSummary', { conid });
},
summaryCommand_meta: true,
async summaryCommand({ conid, command, row }, req) {
testConnectionPermission(conid, req);
const opened = await this.ensureOpened(conid);
if (opened.connection.isReadOnly) return false;
return this.loadDataCore('summaryCommand', { conid, command, row });
},
};

View File

@@ -118,14 +118,19 @@ async function handleDriverDataCore(msgid, callMethod) {
}
}
async function handleServerSummary({ msgid, options }) {
async function handleServerSummary({ msgid }) {
return handleDriverDataCore(msgid, driver => driver.serverSummary(systemConnection));
}
async function handleSummaryCommand({ msgid, command, row }) {
return handleDriverDataCore(msgid, driver => driver.summaryCommand(systemConnection, command, row));
}
const messageHandlers = {
connect: handleConnect,
ping: handlePing,
serverSummary: handleServerSummary,
summaryCommand: handleSummaryCommand,
createDatabase: props => handleDatabaseOp('createDatabase', props),
dropDatabase: props => handleDatabaseOp('dropDatabase', props),
};