This is a discussion on [rrd-users] Clarification on Computing Totals within the RRD Users forums, part of the Networking and Network Related category; --===============1527458164== Content-type: multipart/alternative; Boundary="0__=0ABBFEBFDFF842BC8f9e8a93df938690918c 0ABBFEBFDFF842BC" Content-Disposition: inline --0__=0ABBFEBFDFF842BC8f9e8a93df938690918c0ABBFEBFDF F842BC Content-type: text/...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============1527458164==
Content-type: multipart/alternative; Boundary="0__=0ABBFEBFDFF842BC8f9e8a93df938690918c 0ABBFEBFDFF842BC" Content-Disposition: inline --0__=0ABBFEBFDFF842BC8f9e8a93df938690918c0ABBFEBFDF F842BC Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Hi, I have been using RRDtool with great success for a few years, and while= those of us on the pointy end of the swords can get what we need from t= he graphs, upper management too often calls me needing totals within minut= es for a conference call they are on, or meeting they are in. To combat th= is, the no brainer was to write a script, and though I don't profess to be = a real Perl programmer, I can usually get what I need. In this case though, it's not the code that is confusing me, but someth= ing I read in Alex's "Computing Amount of Data Transferred" tutorial. BTW, = I thought the tutorial was great! I was in the process of writing logic t= hat would based upon the dates selected, choose the appropriate RRA. I was elated to read that fetch takes care of that for me....that all the dat= a will come from the same RRA, hence having the same step size. My point of confusion is that I would think that to compute the total o= f, let's say packets, since that's what I'm dealing with, I would need to maintain a running total of the (current value * step size). This would= leave me to believe that if the current value was 10 and the step size = was 7200 I would have a total of 72000 packets in a two hour period. The ma= th would be easy as ( 10 packets/second * 7200 seconds ) =3D ((10 * 7200 packets) * seconds/seconds) =3D 72000 packets. However, reading the tutorial, I infer that this is not correct, and I = am having a mental block figuring out why. I am going to paste the piece o= f the tutorial that is confusing me, hopefully that will be acceptable. "Each row in an RRA represents an amount of time and a rate. The rate i= s measured in bytes per second, the time in seconds. Some easy math shows= that unless the amount of time is zero, you can get rid of it: (byte/second)*second =3D (byte*second)/second =3D byte*(second/second) = =3D byte*1=3Dbyte. (If "second" is zero, then "second/second" is undefined. This is why it= doesn't work when second equals zero.) When dealing with other rates, it works similar. If you have multiplied= the input by 3600 (for instance to get messages per hour) then the result o= f the computation in the paragraph above is also 3600 times what it shoul= d be. Remember that when you continue..." It is the last paragraph that I am most concerned with, for I have multiplied my packets per second by the step size to achieve the total = in each row - maintaining a running total of the rows, and as I understand= the above, this is incorrect. As I understand the tutorial, I should just b= e maintaining a running total of the values, and not multiply them in eac= h row by the step size. Is that correct? Thank you, Jeff Petter = --0__=0ABBFEBFDFF842BC8f9e8a93df938690918c0ABBFEBFDF F842BC Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable <html><body> <p><font size=3D"2">Hi,</font><br> <br> <font size=3D"2">I have been using RRDtool with great success for a few= years, and while those of us on the pointy end of the swords can get w= hat we need from the graphs, upper management too often calls me needin= g totals within minutes for a conference call they are on, or meeting t= hey are in. To combat this, the no brainer was to write a script, and t= hough I don't profess to be a real Perl programmer, I can usually get w= hat I need.</font><br> <br> <font size=3D"2">In this case though, it's not the code that is confusi= ng me, but something I read in Alex's "Computing Amount of Data Tr= ansferred" tutorial. BTW, I thought the tutorial was great! I was = in the process of writing logic that would based upon the dates selecte= d, choose the appropriate RRA. I was elated to read that fetch takes ca= re of that for me....that all the data will come from the same RRA, hen= ce having the same step size.</font><br> <br> <font size=3D"2">My point of confusion is that I would think that to co= mpute the total of, let's say packets, since that's what I'm dealing wi= th, I would need to maintain a running total of the (current value * st= ep size). This would leave me to believe that if the current value was = 10 and the step size was 7200 I would have a total of 72000 packets in = a two hour period. The math would be easy as ( 10 packets/second * 7200= seconds ) =3D ((10 * 7200 packets) * seconds/seconds) =3D 72000 packet= s. </font><br> <br> <font size=3D"2">However, reading the tutorial, I infer that this is no= t correct, and I am having a mental block figuring out why. I am going = to paste the piece of the tutorial that is confusing me, hopefully that= will be acceptable.</font><br> <br> <font size=3D"2">"</font>Each row in an RRA represents an amount o= f time and a rate. The rate is measured in bytes per second, the time i= n seconds. Some easy math shows that unless the amount of time is zero,= you can get rid of it: (byte/second)*second =3D (byte*second)/second =3D= byte*(second/second) =3D byte*1=3Dbyte. <p>(If "second" is zero, then "second/second" is un= defined. This is why it doesn't work when second equals zero.) <p>When dealing with other rates, it works similar. If you have multipl= ied the input by 3600 (for instance to get messages per hour) then the = result of the computation in the paragraph above is also 3600 times wha= t it should be. Remember that when you continue...<font size=3D"2">&quo= t;</font> <p><font size=3D"2">It is the last paragraph that I am most concerned w= ith, for I have multiplied my packets per second by the step size to ac= hieve the total in each row - maintaining a running total of the rows, = and as I understand the above, this is incorrect. As I understand the t= utorial, I should just be maintaining a running total of the values, an= d not multiply them in each row by the step size. Is that correct?</fon= t> <p><font size=3D"2">Thank you,</font> <p><font size=3D"2">Jeff Petter</font> <p> <p></body></html>= --0__=0ABBFEBFDFF842BC8f9e8a93df938690918c0ABBFEBFDF F842BC-- --===============1527458164== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ rrd-users mailing list rrd-users@lists.oetiker.ch https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users --===============1527458164==-- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|