Report process cpu/memory usage in debug log

This commit is contained in:
Fedor Indutny 2022-05-09 18:12:04 -07:00 committed by GitHub
parent 8f675cdc16
commit 1b052ad16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 80 additions and 67 deletions

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
import pino from 'pino';
import type { ProcessMetric } from 'electron';
import { isRecord } from '../util/isRecord';
import { redactAll } from '../util/privacy';
import { missingCaseError } from '../util/missingCaseError';
@ -15,6 +16,7 @@ export type FetchLogIpcData = {
remoteConfig: Record<string, unknown>;
statistics: Record<string, unknown>;
user: Record<string, unknown>;
appMetrics: ReadonlyArray<ProcessMetric>;
// We expect `logEntries` to be `Array<LogEntryType>`, but we don't validate that
// upfront—we only validate it when we go to log each line. This improves the