tonyseek / openvpn-status

Parse OpenVPN status logs in Python
https://openvpn-status.readthedocs.io
MIT License
83 stars 31 forks source link

Let people choose if the bytes values must be humanized or not #9

Closed lGuillaume124 closed 6 years ago

lGuillaume124 commented 6 years ago

Hello,

First of all thank you for this useful Python module.

I'm trying to use it with a metrics collector system (Telegraf) to send detailed statistics to an InfluxDB database. I didn't find in the documentation how to not humanize the values returned by Client.bytes_received and Client.bytes_sent. Is it possible?

Guillaume.

tonyseek commented 6 years ago

Hi @lGuillaume124,

How about this?

print unicode(client.bytes_received)  # humanized text
print int(client.bytes_received)      # raw integer, the length of bytes
lGuillaume124 commented 6 years ago

Indeed, thank you very much!