[ANNOUNCE] node-red-contrib-msg-size: beta version

Hi folks,

Since my first days in Node-RED, I wanted to develop a node that calculates the sizes of messages passing through, in other words the "throughput" of my flow. But had never time to implement it...

Until last week, when I decided to extract the logic from my node-red-contrib-msg-speed node: now I finally could reuse the entire (rolling window) logic to implement my new node-red-contrib-msg-size node :champagne: :partying_face: :clinking_glasses:

My personal usage will be monitoring the throughput of my IP camera video streams.
Like in this demo:

For those who want to experiment with it, you can install it from my Github repository from within your .node-red folder (since it hasn't been published on NPM yet!):

npm install bartbutenaers/node-red-contrib-msg-size

As always all "constructive" feedback is very welcome!!

And it would be nice to get some feedback about the following:

  1. Is the name ok, or should I name it e.g. node-red-contrib-throughput, or perhapsnode-red-contrib-msg-throughput, or ...

  2. Are there any other useful features that should be added?

  3. The size of the messages is calculated using the object-sizeof package. But I'm not sure how I should interpret this limitation on their readme page:

    image

    Can anybody explain this with a simple example?

  4. Are there any other limitations you are aware of, which I should add to my readme page (so users are aware of the limitiations)?

  5. Do you have some nice use cases that I can add to my readme page?

P.S. Don't want to disappoint users, but this will most probably my last announcement for 2020 :wink:

Have fun with it!!
Bart

4 Likes

Hi Bart,

I have to ask if that is the right name for it, if it is counting how many messages pass through it as opposed to their size?

I am reading the post as it tells you (and kind of shows you) the number of messages rather than their size.

Hi Andrew,
This node works like this:

  1. It calculates the size of every message running through it.
  2. It sums all those message sizes that arrive during the specified interval
  3. It outputs that "total" size of all messages (within the specified interval) and - as an extra output parameter - it also outputs the "average" size of each message.

Let's take the example from my readme page:

image

Here the interval specified (in the config screen) is 1 minute. During that minute 3 messages arrive, and their total size = 3 + 5 + 7 = 15 KB per minute (and the average size will be 15 / 3 = 5 KB per minute).

So it is not about counting messages.
If you have any ideas to make this more clear, please share it!!

I have added this example calculation to the readme page ...

Ah! Silly me... I was distracted by the big flashing number (bottom right) showing the number of messages.

I stand corrected. Sorry. It seems today is going to be one of those days.

1 Like

I don't think you need to worry too much about that as it would only apply to objects containing code - e.g. a function. I think that is discouraged at best and indeed, I'm not even sure it works. That is because the msg has to be serializable and code is not.

1 Like

Since I received no objections about the name of my node, version 1.0.0 of node-red-contrib-msg-size is now published on NPM:

image

I have added keywords (like bandwith", "throughput ...), so users will be redirected to my node anyway on flows.nodered.org during their search ...

1 Like