-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove system property from payload with Deno memory usage
- Loading branch information
Showing
3 changed files
with
1 addition
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,14 +75,6 @@ export function getDenoWrapperPath(): string { | |
} | ||
} | ||
|
||
// https://deno.land/[email protected]?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<AppStatus> { | ||
// If the process has been terminated, we can't get the status | ||
if (this.deno.exitCode !== null) { | ||
|
@@ -496,28 +482,21 @@ 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? | ||
if (logs) { | ||
await this.logStorage.storeEntries(logs); | ||
} | ||
|
||
if (system) { | ||
this.latestSystemRecord = system; | ||
} | ||
|
||
this.emit(`result:${id}`, result, error); | ||
} | ||
|
||
|