Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@krisdages/electron-process-reporter

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@krisdages/electron-process-reporter

Utility to extract interesting process reports of an Electron application.

  • 2.0.0-rxjs7-1.4.0
  • rxjs7
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

electron-process-reporter

Utility to extract interesting process reports of an Electron application.

Installation

$ npm install --save electron-process-reporter

Usage

onExtendedProcessMetrics

Returns an Rx.Observable that emits reports of ExtendedProcessMetric every options.samplingInterval ms.

import { app } from 'electron';
import { onExtendedProcessMetrics } from 'electron-process-reporter';

onExtendedProcessMetrics(app, { samplingInterval: 1000 }) // returns a rx.Observable
  .subscribe(report => console.log(report))

onExcessiveCPUUsage

Will emit ExtendedProcessMetric[] when a process exceeds the options.percentCPUUsageThreshold on more than options.samplesCount samples.

import { app } from 'electron';
import { onExcessiveCPUUsage } from 'electron-process-reporter';

onExcessiveCPUUsage(
  app,
  {
    samplesCount: 1,
    percentCPUUsageThreshold: 90,
  }) // returns a rx.Observable
  .subscribe(report => console.log(report))

onProcessTreeMetricsForPid

Returns an Rx.Observable that emits PidUsage[] every options.samplingInterval ms.

import { onProcessTreeMetricsForPid } from 'electron-process-reporter';

onProcessTreeMetricsForPid(process.pid, { samplingInterval: 1000 }) // returns a rx.Observable
  .subscribe(report => console.log(report))

onExcessiveCPUUsageInProcessTree

Will emit PidUsage[] when a process of the tree exceeds the options.percentCPUUsageThreshold on more than options.samplesCount samples.

import { onExcessiveCPUUsageInProcessTree } from 'electron-process-reporter';

onExcessiveCPUUsageInProcessTree(
  process.pid, // in the main process
  {
    samplesCount: 1,
    percentCPUUsageThreshold: 90,
  }) // returns a rx.Observable
  .subscribe(report => console.log(report))

FAQs

Package last updated on 26 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc