Remnawave_Node/libs/contract/commands/stats/get-system-stats.command.ts

36 lines
1.1 KiB
TypeScript

import { z } from 'zod';
import { NodeSystemStatsSchema } from '../../models';
import { REST_API } from '../../api';
export namespace GetSystemStatsCommand {
export const url = REST_API.STATS.GET_SYSTEM_STATS;
export const ResponseSchema = z.object({
response: z.object({
xrayInfo: z
.object({
numGoroutine: z.number(),
numGC: z.number(),
alloc: z.number(),
totalAlloc: z.number(),
sys: z.number(),
mallocs: z.number(),
frees: z.number(),
liveObjects: z.number(),
pauseTotalNs: z.number(),
uptime: z.number(),
})
.nullable(),
plugins: z.object({
torrentBlocker: z.object({
reportsCount: z.number(),
}),
}),
system: z.object({
stats: NodeSystemStatsSchema,
}),
}),
});
export type Response = z.infer<typeof ResponseSchema>;
}