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

@hapi/oppsy

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hapi/oppsy

An EventEmitter useful for collecting hapi server ops information

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
32K
increased by7.46%
Maintainers
1
Weekly downloads
 
Created
Source

oppsy

An EventEmitter useful for collecting hapi server ops information.

Build Status

Usage

const Hapi = require('@hapi/hapi');
const Oppsy = require('@hapi/oppsy');

const server = new Hapi.Server();
const oppsy = new Oppsy(server);
oppsy.on('ops', (data) => {
  console.log(data);
});

await server.start();

oppsy.start(1000);

This creates a new Oppsy object and starts collecting information every 1000 miliseconds

new Oppsy(server, [config])

Creates a new Oppsy object.

  • server - the hapi server to collect information about.
  • [config] - optional configuration object
    • httpAgents - the list of httpAgents to report socket information about. Can be a single http.Agent or an array of agents objects. Defaults to Http.globalAgent.
    • httpsAgents - the list of httpsAgents to report socket information about. Can be a single https.Agent or an array of agents. Defaults to Https.globalAgent.

The oppsy object is an EventEmitter so it exposes the same API(.on and .emit) as the Node EventEmitter object. After it is started, it emits an "ops" event after a set interval with the collected ops information as the event payload.

oppsy.start(interval)

Starts an Oppsy object collecting network and server information.

  • interval - number of milliseconds to wait between each data sampling.
oppsy.stop()

Stops an Oppsy objects collecting.

Keywords

FAQs

Package last updated on 25 Apr 2019

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