wmifs: Throw out first /proc/net/dev reading.
If we keep it, we start with a huge spike and everything else is zero until the spike finally leaves the window several moments later.
This commit is contained in:
parent
9601a58aae
commit
951f7624c6
|
@ -419,6 +419,7 @@ void wmifs_routine(int argc, char **argv)
|
||||||
|
|
||||||
int stat_online;
|
int stat_online;
|
||||||
int stat_current;
|
int stat_current;
|
||||||
|
int first_time = 1;
|
||||||
|
|
||||||
unsigned int curtime;
|
unsigned int curtime;
|
||||||
unsigned int nexttime;
|
unsigned int nexttime;
|
||||||
|
@ -545,9 +546,13 @@ draw_window:
|
||||||
|
|
||||||
for (i = 0; i < stat_online; i++) {
|
for (i = 0; i < stat_online; i++) {
|
||||||
get_statistics(stat_devices[i].name, &ipacket, &opacket, &istat, &ostat);
|
get_statistics(stat_devices[i].name, &ipacket, &opacket, &istat, &ostat);
|
||||||
|
|
||||||
|
if (first_time) {
|
||||||
|
first_time = 0;
|
||||||
|
} else {
|
||||||
stat_devices[i].his[53][0] += istat - stat_devices[i].istatlast;
|
stat_devices[i].his[53][0] += istat - stat_devices[i].istatlast;
|
||||||
stat_devices[i].his[53][1] += ostat - stat_devices[i].ostatlast;
|
stat_devices[i].his[53][1] += ostat - stat_devices[i].ostatlast;
|
||||||
|
}
|
||||||
|
|
||||||
if (i == stat_current) {
|
if (i == stat_current) {
|
||||||
if (!stillonline(stat_devices[i].name))
|
if (!stillonline(stat_devices[i].name))
|
||||||
|
|
Loading…
Reference in a new issue