newStaffLDB-API #48

Merged
fred.boniface merged 85 commits from newStaffLDB-API into main 2023-10-03 21:35:03 +01:00
Showing only changes of commit dc9a5e15da - Show all commits

View File

@ -1,8 +1,9 @@
const log = require("../utils/logs.utils"); // Log Helper
const db = require("../services/dbAccess.services"); const db = require("../services/dbAccess.services");
const os = require("os"); const os = require("os");
const vers = require("../configs/version.configs"); const vers = require("../configs/version.configs");
import { logger } from "../utils/logger.utils";
async function buildJson() { async function buildJson() {
let json = {}; let json = {};
json.count = {}; json.count = {};
@ -34,14 +35,13 @@ async function buildJson() {
} }
async function hits() { async function hits() {
log.out("statsServices.hits: Statistics Requested", "info"); logger.debug("statsServices.hits: Statistics Requested");
const out = await buildJson(); const out = await buildJson();
log.out(`statsServices.hits: Sending Data: ${JSON.stringify(out)}`, "info");
return out; return out;
} }
async function getVersions() { async function getVersions() {
log.out("statsServices.getVersions: Fetching versions", "info"); logger.debug("statsServices.getVersions: Fetching versions");
const dbMan = await db.query("versions", { target: "dbmanager" }); const dbMan = await db.query("versions", { target: "dbmanager" });
const mqClt = await db.query("versions", { target: "mq-client" }); const mqClt = await db.query("versions", { target: "mq-client" });
const data = { const data = {
@ -53,7 +53,7 @@ async function getVersions() {
} }
async function statistics() { async function statistics() {
log.out("statsServices.statistics: Fetching statistics", "info"); logger.debug("statsServices.statistics: Fetching statistics");
const countersPromise = db.query("meta", { target: "counters" }); const countersPromise = db.query("meta", { target: "counters" });
const timetablePromise = db.query("meta", { target: "timetable" }); const timetablePromise = db.query("meta", { target: "timetable" });