Bug 219829 - "systat -if 1" Peak has wrong display
Summary: "systat -if 1" Peak has wrong display
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 11.0-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
: 160412 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-06-07 02:14 UTC by rezo
Modified: 2019-06-23 19:22 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rezo 2017-06-07 02:14:52 UTC
My uname -a:
FreeBSD GIEPHER-PHP 11.0-RELEASE-p4 FreeBSD 11.0-RELEASE-p4 #0 r309666: Thu Dec  8 17:44:40 CST 2016     giepher@GIEPHER-PHP:/usr/obj/usr/src/sys/GIEPHER_PHP_DEBUG  amd64

I use "systat -if 1" last night before I leave my office, today it shows a very large numbers that are impossible just like below:
                    /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
     Load Average   ||   

      Interface           Traffic               Peak                Total
       vboxnet0  in      0.000 KB/s          2.868 MB/s          120.139 MB
                 out     0.000 KB/s          0.204 KB/s          782.491 KB

        bridge0  in      0.000 KB/s          0.000 KB/s          450.108 MB
                 out     0.432 KB/s     16777216.000 TB/s          1.078 GB

            lo0  in      0.000 KB/s     16777216.000 TB/s          2.694 MB
                 out     0.000 KB/s     16777216.000 TB/s          2.694 MB

            re0  in      4.678 KB/s     16777216.000 TB/s         10.189 GB
                 out     0.432 KB/s     16777216.000 TB/s          1.226 GB
Comment 1 Fabian Keil 2017-06-07 09:21:28 UTC
systat uses gettimeofday() calls to measure the time difference
between updates.

If the system time jumps, the "elapsed" time can appear to be
less than a second in which case the devisions in fetchifstat()
will result in the devided variables becoming larger.

systat should probably be changed to use clock_gettime()
with a monotonic clock.
Comment 2 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-29 00:20:09 UTC
*** Bug 160412 has been marked as a duplicate of this bug. ***
Comment 3 Mateusz Piotrowski freebsd_committer 2019-06-23 19:22:38 UTC
I get similarly weird Peak information when I have "systat -if 1" running when I restart the netif service:

>                     /0   /1   /2   /3   /4   /5   /6   /7   /8   /9   /10
>      Load Average   ||||
> 
>       Interface           Traffic               Peak                Total
>           lagg0  in      3.850 KB/s     16718284.049 TB/s          4.754 KB
>                  out     4.127 KB/s     16718284.049 TB/s          5.292 KB
> 
>           wlan0  in      3.850 KB/s     16718267.389 TB/s          4.754 KB
>                  out     4.127 KB/s     16718267.389 TB/s          5.292 KB
> 
>             lo0  in      0.000 KB/s          0.000 KB/s          317.986 KB
>                  out     0.000 KB/s          0.000 KB/s          317.986 KB

I'm running FreeBSD 13.0-CURRENT r348877 GENERIC-NODEBUG  amd64.