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

azure-status-page-client

v0.1.0

Published

Client which can be used with the Azure Status Page Site Extension in nodejs based applications

Downloads

4

Readme

Azure Status Page - Client for Node.js

Please find more information about the Azure Status Page Generator in the following repository. This repository cotains the code for the NodeJs client to send meter information from a node application to the Status Page.

Azure Status Page Generator: https://github.com/dei79/azure-status-page

Usage

Step 1: Load the Meter Manager The Meter Manager is the single object which will be used to register and update new meters for the Status Page.

let MeterManager = require('../index.js').MeterManager;

Step 2: Define all supported Meters Define all supported Meters your application wants to send update notifications to the Status Page. In the first place the Status Page aggregates all meters in the same category as one service group in the status page.

// Just define the meter ids
let webJobMeter    = '20C8CFBC-4669-45E5-9090-124A28D3942E';
let diskSpaceMeter = '4047A057-E2EF-44AC-B0E3-341EAF0ED09D';

// Register a specific meter which expect a heartbeat every 500 seconds, good to observe continous background worker listening on a queue
MeterManager.RegisterMeter(webJobMeter, 'Spending Data Processing', 'Background Processing', MeterManager.MeterTypes.Heartbeat, 100, 500);

// Register a specific meter which expect that the value will not become less then the specific min value, good for observing diskspace or something like that
MeterManager.RegisterMeter(diskSpaceMeter, 'Free Diskspace for Caching', 'Caching', MeterManager.MeterTypes.MinValue, 200, 10 * 1024 * 1024 * 1024);

Step 3: Configure the correct Azure Storage Account The Status Page Generator relies totally on Azure Storage which means the MeterManager must be configured correctly with a set on storage credentials. Optional a tablename can be provided as well.

MeterManager.ConfigureAzureTableStoreRepository('<<STORAGENAME>>', '<<STORAGESECRET>>');

Step 4: Update Meters where ever is necessar Just update the meter where ever it makes sense, e.g. when a job is waiting for messages from a queue or when you are maintaining the cache from time to time. Calling UpdateMeter without any value means just the timestamp will be updated which is good for HeartBeat meters.

Every Meter can be used on different instances, threads and/or nodes. Because of that you need to provide a MeterInstanceId. The Status Page is aggregating the different instances to one status and allows you to dig into the root cause on a specific instance.

MeterManager.UpdateMeter(webJobMeter, 'Node12237.WebJob.01').then(() => {
    MeterManager.UpdateMeter(diskSpaceMeter, 'Node12237', 14 * 1024 * 1024 * 1024).then(() => {
        // DONE
    });
}).catch((e) => {
    // PROCESS ERROR 
});

Step 5: Remove Meters during graceful shutdown If you want to disconnect a component form the meter system structure it's possible to remove the MeterInstances from the client side.

MeterManager.RemoveMetersForInstance('Node12237').then(() => {
   // DONE 
});

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :)