diff --git a/deno-runtime/lib/messenger.ts b/deno-runtime/lib/messenger.ts index 8d920f5ae..1e9ffe05c 100644 --- a/deno-runtime/lib/messenger.ts +++ b/deno-runtime/lib/messenger.ts @@ -141,8 +141,6 @@ export async function errorResponse({ error: { message, code = -32000, data = {} data.logs = logger.getLogs(); } - data.system = Deno.memoryUsage(); - const rpc = jsonrpc.error(id, new jsonrpc.JsonRpcError(message, code, data)); await Queue.enqueue(rpc); @@ -156,8 +154,6 @@ export async function successResponse({ id, result }: SuccessResponseDescriptor) payload.logs = logger.getLogs(); } - payload.system = Deno.memoryUsage(); - const rpc = jsonrpc.success(id, payload); await Queue.enqueue(rpc); diff --git a/src/server/managers/AppRuntimeManager.ts b/src/server/managers/AppRuntimeManager.ts index e6a284d4b..5f9a3f15a 100644 --- a/src/server/managers/AppRuntimeManager.ts +++ b/src/server/managers/AppRuntimeManager.ts @@ -52,8 +52,4 @@ export class AppRuntimeManager { delete this.subprocesses[appId]; } } - - public getSystemRecords() { - return Object.values(this.subprocesses).map((ctl) => ({ appId: ctl.getAppId(), system: ctl.getLatestSystemRecord() })); - } } diff --git a/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 5e0455464..f741d9b38 100644 --- a/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -75,14 +75,6 @@ export function getDenoWrapperPath(): string { } } -// https://deno.land/api@v1.44.4?s=Deno.MemoryUsage -export type DenoSystemUsageRecord = { - rss: number; - heapTotal: number; - heapUsed: number; - external: number; -}; - export type DenoRuntimeOptions = { timeout: number; }; @@ -98,8 +90,6 @@ export class DenoRuntimeSubprocessController extends EventEmitter { private state: 'uninitialized' | 'ready' | 'invalid' | 'unknown' | 'stopped'; - private latestSystemRecord: DenoSystemUsageRecord | undefined; - private readonly accessors: AppAccessorManager; private readonly api: AppApiManager; @@ -212,10 +202,6 @@ export class DenoRuntimeSubprocessController extends EventEmitter { return this.state; } - public getLatestSystemRecord() { - return this.latestSystemRecord; - } - public async getStatus(): Promise { // If the process has been terminated, we can't get the status if (this.deno.exitCode !== null) { @@ -496,17 +482,14 @@ export class DenoRuntimeSubprocessController extends EventEmitter { let result: unknown; let error: jsonrpc.IParsedObjectError['payload']['error'] | undefined; let logs: ILoggerStorageEntry; - let system: DenoSystemUsageRecord; if (message.type === 'success') { - const params = message.payload.result as { value: unknown; logs?: ILoggerStorageEntry; system?: DenoSystemUsageRecord }; + const params = message.payload.result as { value: unknown; logs?: ILoggerStorageEntry }; result = params.value; logs = params.logs; - system = params.system; } else { error = message.payload.error; logs = message.payload.error.data?.logs as ILoggerStorageEntry; - system = message.payload.error.data?.system as DenoSystemUsageRecord; } // Should we try to make sure all result messages have logs? @@ -514,10 +497,6 @@ export class DenoRuntimeSubprocessController extends EventEmitter { await this.logStorage.storeEntries(logs); } - if (system) { - this.latestSystemRecord = system; - } - this.emit(`result:${id}`, result, error); }