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

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300>\
**Category:** Share Your Nodes\
**Created:** [30 December 2020 20:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300 "2020-12-30T20:39:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2020 20:39 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/1 "2020-12-30T20:39:58Z")

</div>

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](https://discourse.nodered.org/t/share-functionality-between-nodes/37717/8) 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](https://github.com/bartbutenaers/node-red-contrib-msg-size/blob/main/README.md) node 🍾 🥳 🥂

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

 ![msg_size_demo](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/d/dd063bf778d0d495e193755f9e4c00f043072731.gif)

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!):

```auto
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 perhaps_ **node-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](https://www.npmjs.com/package/object-sizeof) package. But I'm not sure how I should interpret this limitation on their readme page:

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 😉

Have fun with it!!  
Bart

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 December 2020 20:50 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/2 "2020-12-30T20:50:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2020 20:58 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/3 "2020-12-30T20:58:34Z")

</div>

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c29460725ef9dd1fb8e9accd82af188561100a94.png)

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!!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [30 December 2020 21:08 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/4 "2020-12-30T21:08:18Z")

</div>

> [@BartButenaers](#):
>
> 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).

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

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [30 December 2020 21:10 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/5 "2020-12-30T21:10:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 December 2020 21:17 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/6 "2020-12-30T21:17:10Z")

</div>

> [@BartButenaers](#):
>
> But I'm not sure how I should interpret this limitation on their readme page:

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.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [5 January 2021 23:15 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-msg-size-beta-version/38300/7 "2021-01-05T23:15:29Z")

</div>

> [@BartButenaers](#):
>
> - Is the name ok, or should I name it e.g. _ **node-red-contrib-throughput** _ , or perhaps _ **node-red-contrib-msg-throughput** _ , or ...

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](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/0/80ceabd1772ebac798a29f6a2f30a0b32a499254.png)

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