
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
healthcheck-monitor
Advanced tools
Health check anything, with this core functionality of monitoring health checks
Core functionality of monitoring healthcheck.
If you have any requests/issues please open an issue at Github.
//All fields with defaults
const {HealthCheckMonitor , STATUS} = require('healthcheck-monitor');
const healthCheckMonitor = new HealthCheckMonitor({
interval : 5000, //MS, Interval between definitive results
//BTW any field will be resovled if it's a function
//It gives you total control on the values at any time
//An example to a changin interval 1-3 seconds:
// interval : ()=>{return (Math.floor(Math.random()*3) + 1)*1000},
timeout : 5000, //MS, Time to wait till decided an action will be dicarded due to a timeout
startPeriod : 0, //MS, Time to ater start() called
retries : 1, //If service is unhealthy how many retry action to preform till definitive test result.
retryPauseTime : 0,//MS, how much time to wait between each retry
healthyAfter : 2, //How many consecutive healty action recorded before deciding the status is healty
unhealthyAfter : 1,//How many consecutive unhealty action recorded before deciding the status is unhealty
action : (testInfo , onResponse)=>{
//Synchronous / Asynchronous action
onResponse(STATUS.UNHEALTHY);
})
});
function statusCheckAction(testInfo , onResponse){
//Synchronous / Asynchronous action
//If success
onResponse(STATUS.HEALTHY)
//If error
onResponse(STATUS.UNHEALTHY)
}
//Simple to start
healthCheckMonitor.start();
//You can wait for the first definitive status when starting
healthCheckMonitor.start((testResult)=>{
//You will also get that first status testResult
});
//You can pause the helthcheck at any time
healthCheckMonitor.pause();
//After pausing you can simply resume
healthCheckMonitor.resume();
//Or get notfied on the first definitive answer after resuming
healthCheckMonitor.resume((testResult)=>{
//You will also get that first status testResult
});
//You can even invok a manual test
healthCheckMonitor.test((testResult)=>{
//You will also get that first status testResult
});
//Listen to events
healthCheckMonitor.on('statusChange' , (status)=>{
//For any change of status after
//waiting `healthyAfter` or `unhealthyAfter`
//will be called with the new status (enum STATUS)
});
healthCheckMonitor.on('testResult' , (testResult)=>{
//For every single check you will get an event with a `TestResult`
});
//You can also get information about the status at any time
healthCheckMonitor.isChanging //true, if it's currently transitioning to a different status
healthCheckMonitor.transitionStatus //enum STATUS, the status we are currently transitioning to.
Health checking is known to be an important part of service integration, in addition it's an important part of any integration, even internal one. Some common use cases:
Because this gives you the core functinality of testing, you are left to decide only what is the action you are testing.
FAQs
Health check anything, with this core functionality of monitoring health checks
We found that healthcheck-monitor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.