mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-22 09:39:57 -06:00
28 lines
663 B
JavaScript
Executable File
28 lines
663 B
JavaScript
Executable File
import { asyncHandler } from "../utils/errorUtils.js";
|
|
|
|
const SERVICE_NAME = "diagnosticController";
|
|
|
|
const obs = new PerformanceObserver((items) => {
|
|
const entry = items.getEntries()[0];
|
|
performance.clearMarks();
|
|
});
|
|
obs.observe({ entryTypes: ["measure"] });
|
|
class DiagnosticController {
|
|
constructor({ diagnosticService }) {
|
|
this.diagnosticService = diagnosticService;
|
|
}
|
|
|
|
getSystemStats = asyncHandler(
|
|
async (req, res, next) => {
|
|
const diagnostics = await this.diagnosticService.getSystemStats();
|
|
return res.success({
|
|
msg: "OK",
|
|
data: diagnostics,
|
|
});
|
|
},
|
|
SERVICE_NAME,
|
|
"getSystemStats"
|
|
);
|
|
}
|
|
export default DiagnosticController;
|