Skip to content

Commit

Permalink
refactor: add container metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Siumauricio committed Jan 1, 2025
1 parent f315500 commit 3b17c64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/monitoring/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { logServerMetrics } from "./server/server.js";
import { config } from "dotenv";
import { serverLogFile, containerLogFile } from "./constants.js";
import { processMetricsFromFile } from "./utils.js";
// import { logContainerMetrics } from "./containers/index.js";
import { logContainerMetrics } from "./containers/index.js";
import { existsSync } from "node:fs";
config();

Expand All @@ -25,7 +25,7 @@ app.use(
}),
);
logServerMetrics();
// logContainerMetrics();
logContainerMetrics();

app.use("/*", cors());
// app.use(
Expand Down
3 changes: 0 additions & 3 deletions apps/monitoring/src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const getServerMetrics = async () => {

// Calcular memoria usada en GB

console.log("Memory:", mem);
const memTotalGB = mem.total / 1024 / 1024 / 1024;
const memUsedGB = (mem.total - mem.available) / 1024 / 1024 / 1024;
// const memUsedGB = (mem.total - mem.free - mem.buffcache) / 1024 / 1024 / 1024;
Expand Down Expand Up @@ -55,8 +54,6 @@ export const logServerMetrics = () => {
setInterval(async () => {
const metrics = await getServerMetrics();

console.log("Metrics:", metrics);

const logLine = `${JSON.stringify(metrics)}\n`;

// Verificar si el archivo existe y su tamaño
Expand Down

0 comments on commit 3b17c64

Please sign in to comment.