Skip to content

Commit

Permalink
Add request-response logs to MATLAB service
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Mar 8, 2024
1 parent a35dbb3 commit 9bdcfde
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/procedures/matlab/matlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* @alpha
*/

const logger = require("../utils/logger")("matlab");
const axios = require("axios");

const { MATLAB_KEY, MATLAB_URL = "" } = process.env;
Expand Down Expand Up @@ -63,7 +64,14 @@ MATLAB.function = async function (fn, args = [], numReturnValues = 1) {
// - batch requests while starting
// - send requests on start
// - keepWarm
const startTime = Date.now();
const resp = await requestWithRetry(`${MATLAB_URL}/feval-fast`, body, 5);
const duration = Date.now() - startTime;
logger.info(
`${duration} body: ${JSON.stringify(body)} response: ${
JSON.stringify(resp.data)
}`,
);
warmer.keepWarm();
const results = resp.data.FEvalResponse;
// TODO: add batching queue
Expand Down

0 comments on commit 9bdcfde

Please sign in to comment.