Home

Awesome

redis-heartbeat

Build Status Windows Tests Coveralls Coverage

Deps Status npm version npm downloads

Pulse a heartbeat to redis. This can be used to detach or attach servers to nginx or similar problems.

Breaking changes

Version 1.0.0

Install

  npm install redis-heartbeat

Initialize

	var Heartbeat = require( "redis-heartbeat" );
	var HBInst = new Heartbeat( { name: "FOO", identifier: "http://www.bar.biz:4223" } );
	HBInst.on( "error", function( err ){
		// Init errors 
	} )

Options

Methods

.start()

Start the heartbeat.

Return

( Booelan ): If it has been started. Could be false if the heartbeat has been already active

.stop()

Stop the heartbeat.

.isActive()

Ask if the heartbeat is currently active.

Return

( Booelan ): Haertbeat is active

.quit()

Stop the heartbeat anc close the internal connection to redis.
After this this instance cannot be reused.

Events

started

Emitted on start of the intervals

beforeHeartbeat

Emitted before heartbeat write. With this event it's possible to change the heartbeat content in operation

Arguments

connected

Emitted on connection to redis

disconnect

Emitted on a disconnect of redis

error

An internal error occoured.

redis:error

Emitted on general redis error

Arguments

TODO

Release History

VersionDateDescription
1.0.02018-05-07removed metric, to use the heartbeat from node 10
0.3.12017-09-05fixed compiled files
0.3.02017-08-11be able to disable heartbeat with intervalHeartbeat = 0; updated deps; added coverage report
0.2.12016-05-19optimized tests and event handling on quit
0.2.02016-05-18usable from windows; added error event; updated dependencies; better tests
0.1.02016-01-07Added metric p_cpu to measure the process cpu load. Added optional d_avail with the current free disk space. Trigger beforeMetric even if no metricsKey is defined. So you can grab the data without saving it to redis (eg. writing it to elasticsearch or a queue)
0.0.92015-12-15updated dependencies to be used with node 4.2
0.0.82015-05-06fixed time retrieval to use redis time and added a option localtime to force local time. By default it'll use the redis time if connected
0.0.72015-04-27updated dependencies
0.0.62015-04-27added option metricExpire to auto delete unused metrics
0.0.52014-11-20fixed redis key gen method and added ZSET for last active metrics
0.0.32014-11-19added methods .start(), .stop() and .isActive()
0.0.22014-11-19added autostart option
0.0.12014-11-18Initial commit

Other projects

NameDescription
systemhealthNode module to run simple custom checks for your machine or it's connections. It will use redis-heartbeat to send the current state to redis.
rsmqA really simple message queue based on Redis
rsmq-clia terminal client for rsmq
rest-rsmqREST interface for.
redis-notificationsA redis based notification engine. It implements the rsmq-worker to safely create notifications and recurring reports.
nsq-loggerNsq service to read messages from all topics listed within a list of nsqlookupd services.
nsq-topicsNsq helper to poll a nsqlookupd service for all it's topics and mirror it locally.
nsq-nodesNsq helper to poll a nsqlookupd service for all it's nodes and mirror it locally.
nsq-watchWatch one or many topics for unprocessed messages.
node-cacheSimple and fast NodeJS internal caching. Node internal in memory cache like memcached.
redis-sessionsAn advanced session store for NodeJS and Redis
obj-schemaSimple module to validate an object by a predefined schema
connect-redis-sessionsA connect or express middleware to simply use the redis sessions. With redis sessions you can handle multiple sessions per user_id.
task-queue-workerA powerful tool for background processing of tasks that are run by making standard http requests.
soyerSoyer is small lib for serverside use of Google Closure Templates with node.js.
grunt-soy-compileCompile Goggle Closure Templates ( SOY ) templates including the handling of XLIFF language files.
backlunrA solution to bring Backbone Collections together with the browser fulltext search engine Lunr.js

The MIT License (MIT)

Copyright © 2013 Mathias Peter, http://www.tcs.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.