{"id":20942182,"url":"https://github.com/getstation/electron-process-reporter","last_synced_at":"2025-05-13T23:32:39.194Z","repository":{"id":37214453,"uuid":"118210963","full_name":"getstation/electron-process-reporter","owner":"getstation","description":"Utility to extract interesting process reports of an Electron application","archived":false,"fork":false,"pushed_at":"2024-08-27T07:05:20.000Z","size":644,"stargazers_count":9,"open_issues_count":12,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-27T08:27:48.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getstation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-20T05:04:11.000Z","updated_at":"2024-08-27T08:27:59.671Z","dependencies_parsed_at":"2024-08-27T08:27:50.864Z","dependency_job_id":"fa4d00ea-a0e7-4d4c-b204-e468b483366e","html_url":"https://github.com/getstation/electron-process-reporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-process-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-process-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-process-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getstation%2Felectron-process-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getstation","download_url":"https://codeload.github.com/getstation/electron-process-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225266533,"owners_count":17447000,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T23:24:17.621Z","updated_at":"2024-11-18T23:24:18.109Z","avatar_url":"https://github.com/getstation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# electron-process-reporter\nUtility to extract interesting process reports of an Electron application.\n\n## Installation \n```bash\n$ npm install --save electron-process-reporter\n```\n\n## Usage\n\n### onExtendedProcessMetrics\nReturns an Rx.Observable that emits reports of `ExtendedProcessMetric` every `options.samplingInterval` ms.\n```js\nimport { app } from 'electron';\nimport { onExtendedProcessMetrics } from 'electron-process-reporter';\n\nonExtendedProcessMetrics(app, { samplingInterval: 1000 }) // returns a rx.Observable\n  .subscribe(report =\u003e console.log(report))\n```\n\n### onExcessiveCPUUsage\nWill emit `ExtendedProcessMetric[]` when a process exceeds the `options.percentCPUUsageThreshold` on more than `options.samplesCount` samples.\n```js\nimport { app } from 'electron';\nimport { onExcessiveCPUUsage } from 'electron-process-reporter';\n\nonExcessiveCPUUsage(\n  app,\n  {\n    samplesCount: 1,\n    percentCPUUsageThreshold: 90,\n  }) // returns a rx.Observable\n  .subscribe(report =\u003e console.log(report))\n```\n\n### onProcessTreeMetricsForPid\nReturns an Rx.Observable that emits `PidUsage[]` every `options.samplingInterval` ms.\n```js\nimport { onProcessTreeMetricsForPid } from 'electron-process-reporter';\n\nonProcessTreeMetricsForPid(process.pid, { samplingInterval: 1000 }) // returns a rx.Observable\n  .subscribe(report =\u003e console.log(report))\n```\n\n### onExcessiveCPUUsageInProcessTree\nWill emit `PidUsage[]` when a process of the tree exceeds the `options.percentCPUUsageThreshold` on more than `options.samplesCount` samples.\n```js\nimport { onExcessiveCPUUsageInProcessTree } from 'electron-process-reporter';\n\nonExcessiveCPUUsageInProcessTree(\n  process.pid, // in the main process\n  {\n    samplesCount: 1,\n    percentCPUUsageThreshold: 90,\n  }) // returns a rx.Observable\n  .subscribe(report =\u003e console.log(report))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetstation%2Felectron-process-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetstation%2Felectron-process-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetstation%2Felectron-process-reporter/lists"}