Add count parameter to rest_performance
This commit is contained in:
parent
14753bb4ce
commit
de540a2a8a
1 changed files with 4 additions and 1 deletions
|
@ -11,9 +11,12 @@ export const RestPerformanceCmd = botControlCmd({
|
||||||
trigger: ["rest_performance"],
|
trigger: ["rest_performance"],
|
||||||
permission: "can_performance",
|
permission: "can_performance",
|
||||||
|
|
||||||
signature: {},
|
signature: {
|
||||||
|
count: ct.number({ required: false }),
|
||||||
|
},
|
||||||
|
|
||||||
async run({ pluginData, message: msg, args }) {
|
async run({ pluginData, message: msg, args }) {
|
||||||
|
const count = Math.max(1, Math.min(25, args.count || 5));
|
||||||
const stats = getTopRestCallStats(5);
|
const stats = getTopRestCallStats(5);
|
||||||
const formatted = stats.map((callStats) => {
|
const formatted = stats.map((callStats) => {
|
||||||
const cleanSource = callStats.source.replace(leadingPathRegex, "");
|
const cleanSource = callStats.source.replace(leadingPathRegex, "");
|
||||||
|
|
Loading…
Add table
Reference in a new issue