Files
Checkmate/server/controllers/diagnosticController.js
T

27 lines
663 B
JavaScript
Raw Normal View History

import { asyncHandler } from "../utils/errorUtils.js";
2025-07-10 16:08:04 -07:00
2025-04-20 11:29:53 -07:00
const SERVICE_NAME = "diagnosticController";
2025-07-10 16:08:04 -07:00
const obs = new PerformanceObserver((items) => {
const entry = items.getEntries()[0];
performance.clearMarks();
});
obs.observe({ entryTypes: ["measure"] });
2025-04-20 11:29:53 -07:00
class DiagnosticController {
2025-07-23 14:28:16 -07:00
constructor({ diagnosticService }) {
this.diagnosticService = diagnosticService;
2025-04-20 11:29:53 -07:00
}
getSystemStats = asyncHandler(
async (req, res, next) => {
2025-07-23 14:28:16 -07:00
const diagnostics = await this.diagnosticService.getSystemStats();
2025-07-10 16:08:04 -07:00
return res.success({
msg: "OK",
data: diagnostics,
});
},
SERVICE_NAME,
"getSystemStats"
);
2025-04-20 11:29:53 -07:00
}
export default DiagnosticController;