rjweb-server
Version:
Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS
82 lines (81 loc) • 2.42 kB
TypeScript
import { GlobalContext } from "../../types/context";
import { RequestContext } from "../../types/external";
import WebSocket from "../../types/webSocket";
import HTTP from "../../types/http";
export declare const dashboardIndexRoute: (ctg: GlobalContext) => HTTP;
export declare const dashboardWsRoute: (ctg: GlobalContext) => WebSocket;
declare const runStats: (ctg: GlobalContext) => Promise<{
requests: {
total: number;
perSecond: number;
hours: {
hour: import("../../types/context").Hours;
amount: number;
}[];
};
webSockets: {
opened: {
total: number;
perSecond: number;
hours: {
hour: import("../../types/context").Hours;
amount: number;
}[];
};
messages: {
incoming: {
total: number;
perSecond: number;
hours: {
hour: import("../../types/context").Hours;
amount: number;
}[];
};
outgoing: {
total: number;
perSecond: number;
hours: {
hour: import("../../types/context").Hours;
amount: number;
}[];
};
};
};
data: {
incoming: {
total: number;
perSecond: number;
hours: {
hour: import("../../types/context").Hours;
amount: number;
}[];
};
outgoing: {
total: number;
perSecond: number;
hours: {
hour: import("../../types/context").Hours;
amount: number;
}[];
};
};
cpu: {
time: string;
usage: string;
};
memory: {
time: string;
usage: number;
};
routes: {
user: number;
automatic: number;
};
staticFiles: number;
internalLogs: number;
middlewares: number;
cached: number;
}>;
export type DashboardStats = Awaited<ReturnType<typeof runStats>>;
export default function statsRoute(ctr: RequestContext, ctg: GlobalContext, type: 'http' | 'socket'): Promise<import("../../index").HttpRequest<{}, unknown, "/"> | import("../../index").WsConnect<{}, "connect", "/"> | undefined>;
export {};