Skip to content

kervel/node-red-contrib-msg-speed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-red-contrib-msg-speed

A Node Red node for measuring flow message speed.

Install

Run the following npm command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-msg-speed

Usage

This node will count all messages that arrive at the input port, and calculate the message speed every second.

For example when the frequency is 'minute', it will count all the messages received in the last minute:

Timeline 1

A second later, the calculation is repeated: again the messages received in the last minute will be counted.

Timeline 2

The measurement interval is like a moving window, that is being moved every second.

The process continues this way, while the moving window is forgetting old messages and taking into account new messages:

Timeline 3

Remark: The message count will be displayed on the screen:

Timeline 4

Moreover the message count will be send to the output port as message payload. An extra 'frequency' message field is also added (containing 'sec', 'min', 'hour').

Some use cases:

  • Trigger an alarm e.g. when the message rate drops to 0 messages per minute.
  • Performance measurement, e.g. track the number of images per second (received from a camera).

Node configuration

Frequency

The frequency ('second', 'minute', 'hour') defines the interval length of the moving window.

Remark: when the interval becomes longer:

  • It will consume more memory, to store all the calculations.
  • It will take longer at startup to calculate the speed. E.g. for frequency 'hour' the speed will become only correct after one hour (i.e. when the interval of the first hour is complete).

About

A Node Red node for measuring flow message speed

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.8%
  • HTML 28.2%