npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

service_fleet_control

v0.6.8

Published

This modules enables your services to auto anounce themselves to a master service. The idea is for you to know what services are up, down, its status and how can they be reached by your master service.

Downloads

11

Readme

Service Fleet Control Build Status Maintainability dependencies Status

A module for service discovery and health status check for your fleet of microservices Include it in your nodejs services and implement a registry server using this module so you can have information about the status of all of your services.

You only need to configure the module in your clients and you can know at any time what services are up, in what host, what are the basic OS metrics and what your NodeJS service memory usage is.

ALPHA STILL IN DEVELOPMENT!

  • Non secure Net Client/Server has been deprecated; check the new examples
  • The module can already be used for studying its behaviour
  • Working on a complete refactor for stabilizing the API of the Module an it's initial protocol

Install

npm i -save service_fleet_control

@TODO before reaching an stable API & Protocol

  • ~~Implement Registry Server~~
  • ~~Method for retreiving the data~~
  • ~~Add usage examples~~
  • ~~Mark offline hosts via status property 'online'~~
  • ~~Error Handling for net/tls!~~
  • ~~Encryption~~
  • ~~Remove code duplication after TLS support added~~
  • ~~Extract DB methods to its own class~~
  • ~~Make TLS Client Certs Optional~~
  • ~~Implement correct data buffering to support large payloads~~
  • Define inital protocol
  • Improve Buffer Logic (Move to Class)
  • Don't depend on data arrival to registry for refreshing status. Update via interval.
  • Full Error Checking!
  • Add more test coverage
  • Refactor for solving the poor composition/DI implementations
  • Refactor classes using better patterns
  • Add validation schemas for both Service and Registry
  • Create a full sample implementation
  • Drop JSON for Protocol Buffers
  • Add compression (For basic JSON data is not worth - need to research more)

General Concept

  • The module allows for the creation of either a Service Registry or Service Client
  • The Registry listens for updates from clients and keeps track of them
  • The Clients send updates to the Registry
  • The general idea is that the Registry provides a single point for obtaining information about the health of your micro-services
  • Instead of using HTTP it uses TCP to keep the memory & cpu footpring as low as possible

Usage

  • See ./examples/ folder to check how to use this module for your services (Full app example will be created in the comming weeks)
  • The examples have a very low update interval in a real world scenario you will probably check less often than a second
  • Although traffic is encrypted you should never open services ports until they are mature enough so you should use your internal network and proxy the data through another service to the outside world

Debugging

This module uses the Debug module for debugging for example for developement start the apps with

DEBUG=SFC,SFC_registry node your_registry_implementation_or_service_using_the_module.js

Namespaces are:

  • SFC for main module
  • SFC_registry for the registry lib
  • SFC_client for the client lib

Future Features!

  • Allow Services to comunicate its API via swagger or graphql
  • Allow Registry to shootdown Services via exposition of an API

Using this module?

  • Please leave feedback and ideas in its Github Issues Section!
  • Ideas and Collaborators welcome!
  • If this is useful for you donate to an Environmental Organization or Local School needing resources :)

Credits

  • Heziode for the best script for generating certificates for client/server.
  • The local 'Pizza Dev Team' for inspiring me to learn more.

License

GPLv3