mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[ObsUX][Synthtrace] Remove pidusage
for logging cpu usage (#204043)
## Summary Removes `pidusage` in favour of just getting cpu usage stats from `node:process` for logging purposes. Other than that, not sure the point of logging this, but keeping it in case it serves some purpose. Closes #203983 ## How to test Not sure, make sure CI doesn't break or something from its removal, given it is only used for logging.
This commit is contained in:
parent
20b7e238f8
commit
5791d36d88
3 changed files with 8 additions and 17 deletions
|
@ -1635,7 +1635,6 @@
|
|||
"@types/pbf": "3.0.2",
|
||||
"@types/pdfmake": "^0.2.2",
|
||||
"@types/picomatch": "^2.3.0",
|
||||
"@types/pidusage": "^2.0.2",
|
||||
"@types/pixelmatch": "^5.2.4",
|
||||
"@types/pngjs": "^6.0.5",
|
||||
"@types/prop-types": "^15.7.5",
|
||||
|
@ -1807,7 +1806,6 @@
|
|||
"p-reflect": "2.1.0",
|
||||
"peggy": "^1.2.0",
|
||||
"picomatch": "^2.3.1",
|
||||
"pidusage": "^3.0.2",
|
||||
"pirates": "^4.0.1",
|
||||
"piscina": "^3.2.0",
|
||||
"pixelmatch": "^5.3.0",
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
import { timerange } from '@kbn/apm-synthtrace-client';
|
||||
import { castArray } from 'lodash';
|
||||
import pidusage from 'pidusage';
|
||||
import { memoryUsage } from 'process';
|
||||
import { parentPort, workerData } from 'worker_threads';
|
||||
import { getApmEsClient } from './get_apm_es_client';
|
||||
|
@ -123,10 +122,16 @@ async function start() {
|
|||
return Math.round(value / 1024 ** 2).toString() + 'mb';
|
||||
}
|
||||
|
||||
let cpuUsage = process.cpuUsage();
|
||||
|
||||
setInterval(async () => {
|
||||
const stats = await pidusage(process.pid);
|
||||
cpuUsage = process.cpuUsage(cpuUsage);
|
||||
const mem = memoryUsage();
|
||||
logger.info(`cpu: ${stats.cpu}, memory: ${mb(mem.heapUsed)}/${mb(mem.heapTotal)}`);
|
||||
logger.info(
|
||||
`cpu time: (user: ${cpuUsage.user}µs, sys: ${cpuUsage.system}µs), memory: ${mb(
|
||||
mem.heapUsed
|
||||
)}/${mb(mem.heapTotal)}`
|
||||
);
|
||||
}, 5000);
|
||||
|
||||
await logger.perf('index_scenario', async () => {
|
||||
|
|
12
yarn.lock
12
yarn.lock
|
@ -12097,11 +12097,6 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/picomatch/-/picomatch-2.3.0.tgz#75db5e75a713c5a83d5b76780c3da84a82806003"
|
||||
integrity sha512-O397rnSS9iQI4OirieAtsDqvCj4+3eY1J+EPdNTKuHuRWIfUoGyzX294o8C4KJYaLqgSrd2o60c5EqCU8Zv02g==
|
||||
|
||||
"@types/pidusage@^2.0.2":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/pidusage/-/pidusage-2.0.2.tgz#3f8c4b19ba7ea438a733d093661e92b60e5f88ee"
|
||||
integrity sha512-lHgpGZjXDfjggZDLkgp4zQTYkvXq4S7RxjBjrDcPe1MBU72hESWxubutx8+AM4QkJdRxAhrQyxSA6pzHKJKlsQ==
|
||||
|
||||
"@types/pixelmatch@^5.2.4":
|
||||
version "5.2.4"
|
||||
resolved "https://registry.yarnpkg.com/@types/pixelmatch/-/pixelmatch-5.2.4.tgz#ca145cc5ede1388c71c68edf2d1f5190e5ddd0f6"
|
||||
|
@ -26284,13 +26279,6 @@ picomatch@^4.0.2:
|
|||
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab"
|
||||
integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==
|
||||
|
||||
pidusage@^3.0.2:
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/pidusage/-/pidusage-3.0.2.tgz#6faa5402b2530b3af2cf93d13bcf202889724a53"
|
||||
integrity sha512-g0VU+y08pKw5M8EZ2rIGiEBaB8wrQMjYGFfW2QVIfyT8V+fq8YFLkvlz4bz5ljvFDJYNFCWT3PWqcRr2FKO81w==
|
||||
dependencies:
|
||||
safe-buffer "^5.2.1"
|
||||
|
||||
pify@^2.0.0, pify@^2.2.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue