Introduce buffered console logger

This commit is contained in:
Fedor Indutny 2023-03-28 15:22:06 -07:00 committed by GitHub
parent 6dab8c70a1
commit d1791ff6be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 47 deletions

View file

@ -39,7 +39,6 @@ const getHeader = (
capabilities,
remoteConfig,
statistics,
appMetrics,
user,
}: Omit<FetchLogIpcData, 'logEntries'>,
nodeVersion: string,
@ -57,29 +56,6 @@ const getHeader = (
headerSection('User info', user),
headerSection('Capabilities', capabilities),
headerSection('Remote config', remoteConfig),
headerSection(
'Metrics',
appMetrics.reduce((acc, stats, index) => {
const {
type = '?',
serviceName = '?',
name = '?',
cpu,
memory,
} = stats;
const processId = `${index}:${type}/${serviceName}/${name}`;
return {
...acc,
[processId]:
`cpuUsage=${cpu.percentCPUUsage.toFixed(2)} ` +
`wakeups=${cpu.idleWakeupsPerSecond} ` +
`workingMemory=${memory.workingSetSize} ` +
`peakWorkingMemory=${memory.peakWorkingSetSize}`,
};
}, {})
),
headerSection('Statistics', statistics),
headerSectionTitle('Logs'),
].join('\n');