Traffic Graph Peak Scaling



  • I'm not sure if I am remembering this correctly, but I thought in previous releases (>=2.0.1) the traffic graphs scaled down if the traffic was lower during the displayed period.  For example, if I were downloading at 60Mb the graphs scale to a peak of 60Mb.  However, when that peak exits the time period on the graph, the graph would scale down to the 5Mb as a peak if I consumed a maximum of 5Mb during that period.  If I've described that correctly and that should be happening, it's not on my release.

    I am running this version:  2.0.3-PRERELEASE (amd64) built on Fri Dec 7 22:39:16 EST 2012 FreeBSD 8.1-RELEASE-p13

    If it is working as designed–graphs don't scale down from their peak utilization--I'll drink less during the week and hopefully these hallucinations will go away for a while.



  • It still is able to.
    Click on the text "AutoScale (up)" and it will change to "AutoScale (follow)"

    (This is with 2.0.3-PRERELEASE (i386) built on Mon Jan 14 16:52:28 EST 2013)



  • Ah, thanks!  I can barely read the text on the graphs.

    Not sure how that changed in my installation.  Was it set to "follow" as a default in earlier versions?  I don't remember having to change it, but thanks for giving me a clue!



  • In order to see more detail I end up changing it back and forwards - which works fine but is there no way to have it automatically up and down scale?

    TIA



  • Is there a setting I can toggle so the graphs come up with a default to "follow"?  I've searched high and low in the webUI for it and couldn't find it.  I tried a grep search from root and that wasn't the brightest idea.



  • I had the same issue - but wanting to change default units from "bits" to "bytes".

    After some searching - you need to edit a file.
    This is assuming your are using 2.0.1 - although I guess other versions are the same.
    As always - make a backup and don't try this unless you are happy to manually edit files :)

    In file:  graph.php

    You will need to change the start default setting:

    $scale_type="up";
    to
    $scale_type="follow";

    That will change the starting graphs to what you want - even though the wording will say "automatic (follow)".
    If you click the link twice it will correct itself.

    Alternatively, if you want to be complete, change the wording (later in the same file).
    This is not truly necessary but keeps it neat!

    Original:
      scale_type = (scale_type == 'up') ? '' : '';
      SVGDoc.getElementById('switch_scale').firstChild.data = 'AutoScale (' + scale_type + ')';

    Changed
      scale_type = (scale_type == 'follow') ? '' : '';
      SVGDoc.getElementById('switch_scale').firstChild.data = 'AutoScale (' + scale_type + ')';

    Hope this helps -



  • Awesome and thank you for the suggestion.  Found the entry in /usr/local/www/graph.php.  There was a comment on the line indicating that it was default variable, so that helped too.

    All I had to do was change that line to this:

    
    $scale_type="follow";               //Autoscale default setup : "up" = only increase scale; "follow" = increase and decrease scale according to current graphed datas
    
    

    It's right at the top of the file, nice and easy to find.

    Thanks again for your help!



  • Glad to help.  As mentioned that one small change will do what you want and change the default starting option, but the text will be incorrect until you click it a couple of times - not really critical and makes no difference to the actual operation.

    Slowly finding my way around pfS - an awesome program!!



  • I'm actually running the 2.0.3 PRERELEASE and the text looks just fine.  Only needed to make that one tiny change and everything is awesome.



  • Hi :)
    the last days i looked into the php-code from a few pfsense-sites and changed them a little bit.
    So i also changed the graph, so it automaticalls shows the speed in KB/s as default and not kbit/s.
    But i would be glad, if there would be any way to configure the graph like "oh ok. we know opt2 is a 16.000 DSL-Connection, so we set opt2_speed = 16.000. Then the graph's 100% are the 16.000. If opt2 is used by 50% of it's maximum bandwith, then the graph shows the red line in the middle, at 50%".
    Did you get, what i mean?
    If you look at the graphs normally and see "uh, the red line is almost at 100% of the graph" then this could mean 50 kb/s or 5.000 kb/s. You can't see, because the maximum of the graph changes due to the last known peak.

    Is there any way to do this?
    I could get into the thing and programm it myself into the pfsense, but that should be the solution, right? ;)

    Any ideas?
    Best wishes
    spYro



  • There is not a way to easily "guess" the bandwidth of an interface at present - many people will have a 100Mbps ethernet cable between their WAN port and frojnt-end modem device. The front end connection to the internet will usually be much slower than this (depending what their hardware does and what they have paid for from the ISP).
    It would be easy enough to add an attribute to the Interface configuration page that lets you define the expected real throughput speed for the interface.
    Then, if something was set in there, things like Traffic Graph could start scaling at that rate.
    If things like this are done, then it would also be good to have a "Save" button on the Traffic Graph page so users can decide what graph settings they want as default.



  • @phil.davis:

    There is not a way to easily "guess" the bandwidth of an interface at present - many people will have a 100Mbps ethernet cable between their WAN port and frojnt-end modem device. The front end connection to the internet will usually be much slower than this (depending what their hardware does and what they have paid for from the ISP).
    It would be easy enough to add an attribute to the Interface configuration page that lets you define the expected real throughput speed for the interface.
    Then, if something was set in there, things like Traffic Graph could start scaling at that rate.
    If things like this are done, then it would also be good to have a "Save" button on the Traffic Graph page so users can decide what graph settings they want as default.

    Exactly.
    I would enter, for example, that opt2 (or wan2) should be maximum with 16.000 kbit/s.
    If the real Bandwith never reaches this limit, its totally ok. I just want to see, what percentage of the technical-maximum is reached at the moment.
    For a LAN-Interface this would be 100 Mbit/s or 1 Gbit/s.
    I may be ablt to code that into the pfsense-GUI, but for saving this setting to the pfsense-harddrive, i may neet to look into it more deeply. PHP is one thing, but the saving-functions and the config-db…. well, i would love to have this coded into pfsense by one of the pfsense-programmers themself. So i dont need to learn, what they already know and so everyone can have this option in the next update.
    What about it, PFsense-team? :)


Log in to reply