Coder Social home page Coder Social logo

Question xml output hour about vnstat HOT 4 CLOSED

vergoh avatar vergoh commented on July 23, 2024
Question xml output hour

from vnstat.

Comments (4)

vergoh avatar vergoh commented on July 23, 2024

Few comments to begin with

  • --exportdb isn't needed when --xml is given
  • recent versions have --json to output json format directly
  • 1.11 is a rather old version, but it doesn't have --exportdb so which version are you actually using?
  • you mixed traffic.months.month with traffic.hours.hour in your question?

The id of hourly data does indeed follow the current hour unlike with daily and monthly data. Depending on the update method being used, doing a huge download at 1700 o'clock before the update may cause the download to be added to the id 16 instead of id 17. It depends whether an update for id 17 has already been done before the download.

from vnstat.

Hellowlol avatar Hellowlol commented on July 23, 2024

Thanks for your reply.

I'm sorry for mixing the questions but your answered the correct question.

Currently I'm using 1.11, but it's a part of a larger project so the commands depends on what version the user has. The --xml is there is for simplicity (for the same reason is --json not used) https://github.com/Hellowlol/HTPC-Manager/blob/master2/modules/vnstat.py

So say current time is 1700 would id 18, 19 etc usage always be 0 or would it belong to the previous day?

from vnstat.

vergoh avatar vergoh commented on July 23, 2024

If current time is 1700 then id is 17 (think of date +%H) assuming the database has been updated within the current hour. Otherwise id 17 points to the previous day if vnStat has been running for the last 24 hours, if not then id 17 will contain rx 0 and tx 0. Use the date structure from within each hour to check if the data is from the current day or the previous.

from vnstat.

Hellowlol avatar Hellowlol commented on July 23, 2024

Thanks for confirming!

from vnstat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.