Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--json and -tr #56

Closed
ethernetweb opened this issue Apr 1, 2017 · 3 comments
Closed

--json and -tr #56

ethernetweb opened this issue Apr 1, 2017 · 3 comments

Comments

@ethernetweb
Copy link

Greetings,

I have a feature request -
It would be very helpful to my platform and usage needs if it were possible to get the -tr argument output in JSON format.

Thank you for work on this great product.

@vergoh
Copy link
Owner

vergoh commented Apr 5, 2017

For only -tr, that shouldn't be hard too implement. Most likely the JSON output would need to contain a little bit more information (begin and end dates, duration etc.) than the current textual output in order to support more diverse uses.

This appears to be at least partially a duplicate of issue #25.

@ethernetweb
Copy link
Author

ethernetweb commented Apr 5, 2017

Hah, my fault - I overlooked that somehow. I did look at the other issues but that one appears to have escaped me. Thank you again and my apologies for the dupe.

As I've noticed the -tr requires a minimum of a 2 second duration to check (that's what my config option is now). Currently, I'm just using regexp to parse the output as a string. Being able to specify the duration with a command line argument would be slick as well.

@vergoh
Copy link
Owner

vergoh commented Apr 6, 2017

You can already provide -tr with a numeric parameter that will then define the duration in seconds. At least the man page has that documentation. :-)

The 2 second minimum is there to a least average the result a little bit. I recall that the data source vnStat uses updates only about once every second.

@vergoh vergoh closed this as completed in cc2abeb Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants