(The web interface deletes this file after reading it)
The data is in the format [date, rx, tx] where:
date is in 0xYYMMDD, where YY is years since 1900, MM is month starting from zero, and DD is the date of the month
Example: 0x790418 is 2021-05-24
rx is bytes rxed for the day in KB
tx is bytes txed for the day in KB
Alternative implementation
Instead, the statistics file at /var/lib/misc/rstats-history.gz can be read directly:
Decompress the file
Parse the raw bytes. They pretty much map to the above JavaScript almost exactly the same way (little endian), but the values are in bytes instead of kilobytes (/ 1024)
To obtain the data, the following command can be issued:
Afterwards, the file at
/var/spool/rstats-history.js
can be read. Example contents:(The web interface deletes this file after reading it)
The data is in the format
[date, rx, tx]
where:date
is in0xYYMMDD
, whereYY
is years since 1900,MM
is month starting from zero, andDD
is the date of the month0x790418
is 2021-05-24rx
is bytes rxed for the day in KBtx
is bytes txed for the day in KBAlternative implementation
Instead, the statistics file at
/var/lib/misc/rstats-history.gz
can be read directly:/ 1024
)References
GPL_RT_AC1200GPlus_300438252272 / ... / release / src / router / rstats / rstats.c